Borrar filtros
Borrar filtros

image manipulation with moving window.

3 visualizaciones (últimos 30 días)
mahesh chathuranga
mahesh chathuranga el 4 de Oct. de 2013
Comentada: Image Analyst el 4 de Oct. de 2013
i have a image of 256*256 and i have a moving window with (5*5).i want to move this moving window through out my original image,then i want to obtain new image.it's replace the one 5*5 block of the original image into one pixel.is there any method to insert some specific functions to the moving window.(like mean,median)

Respuestas (1)

Image Analyst
Image Analyst el 4 de Oct. de 2013
Try this:
% Sliding mean:
windowSize = 5;
kernel = ones(windowSize, windowSize);
outputImage = conv2(double(grayImage), kernel, 'same');
If you want median, you can use blockproc (let me know if you need demos), or you can use nlfilter() in the Image Processing Toolbox if you want to do some custom operations within the window.
  2 comentarios
mahesh chathuranga
mahesh chathuranga el 4 de Oct. de 2013
can you please give me demos.thank you
Image Analyst
Image Analyst el 4 de Oct. de 2013

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by