How to apply Median filter to a image for fixed number of times using for loop

6 visualizaciones (últimos 30 días)
Hello all,
Simply I want to rewrite below code using for loop.
B = medfilt2( A );
C = medfilt2( B );
D = medfilt2( C );
E = medfilt2( D );
F = medfilt2( E );
Can't figure out how to store image in array or something to call inside for loop.
Thanks

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Dic. de 2015
result{1} = A;
for K = 2 : 6
result{K} = medfilt(result{K-1});
end
  2 comentarios
sacprasanna
sacprasanna el 3 de Dic. de 2015
It works.Is results array or matrix? can I store any thing on it?
Thank You for answer

Iniciar sesión para comentar.

Más respuestas (1)

sacprasanna
sacprasanna el 3 de Dic. de 2015
Editada: Walter Roberson el 3 de Dic. de 2015
For other readers this is rewrite code using help of Walter Roberson
I = imread('Penguins.jpg');
J = rgb2gray(I);
result{1} = J;
for K = 2 : 6
result{K} = medfilt2(result{K-1});
end
imshow(result{5});

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by