sliding window
2 ビュー (過去 30 日間)
古いコメントを表示
How to apply a 3x3 sliding window for an image while the pixel in the center of the window should have the mean value of the window.
0 件のコメント
回答 (3 件)
Ben Mitch
2011 年 5 月 22 日
I think you're after filter2(). Try
mn = filter2(ones(3), im);
5 件のコメント
Image Analyst
2011 年 6 月 12 日
But that's exactly what Ben, Jan, and Sean de's code does! Did you look up the help for filter2()? It is basically conv2() (which is highly optimized) with the 'same' option. (I always use conv2 rather than filter2.) Write a test with a small image to convince yourself.
Jan
2011 年 6 月 11 日
What is "the next 3x3 position"? Will the resulting picture have a width and size reduced by 3? If so, this can achieve the calculation efficiently: FEX: BlockMean
2 件のコメント
Image Analyst
2011 年 6 月 12 日
Patan, how many times do we have to say it. CONV2 AND IMFILTER WILL DO WHAT YOU'RE ASKING!!!!
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!