Median Filter code problem:
Mostrar comentarios más antiguos
Hello Dear Experts,
I am trying to build the median filter with given window size. Here is what I did so far, please correct me because for some reason I don't get the right results:
function [ newImg ] = myMedian( img, rows, cols )
ModifyImg = padarray(img,[1 1]);
for i = 1:(size(ModifyImg,1) - 2)
for j = 1:(size(ModifyImg,2) - 2)
window = zeros(rows,cols);
inc = 1;
for x = 1:rows
for y = 1:cols
window(inc) = ModifyImg(i + x - 1, j + y - 1);
inc = inc + 1;
end
end
Sorted_Window = sort(window);
newImg(i,j) = Sorted_Window(ceil(0.5*rows*cols));
end
end
end
Respuesta aceptada
Más respuestas (1)
Hammad Moussa
el 30 de Mayo de 2021
0 votos
you can help me for fonction filtre media and filtre gaussian script. m
2 comentarios
Image Analyst
el 30 de Mayo de 2021
Is this an answer to @Steve, who posted this 9 years ago? I doubt he will help you, and doubt he will even see your answer/question. You'd be best off posting your own question after reading this:
Steve Solun
el 30 de Mayo de 2021
@Image Analyst Actually it was a great nostalgy to see this question, wow 9 years ago :)
So I do see and get updates :)
@Hammad MoussaI think you can easily find a tutorial for what you're asking by searching G.
Categorías
Más información sobre Neighborhood and Block Processing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!