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!