Median Filter code problem:
이전 댓글 표시
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
채택된 답변
추가 답변 (1개)
Hammad Moussa
2021년 5월 30일
0 개 추천
you can help me for fonction filtre media and filtre gaussian script. m
댓글 수: 2
Image Analyst
2021년 5월 30일
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
2021년 5월 30일
@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.
카테고리
도움말 센터 및 File Exchange에서 Neighborhood and Block Processing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!