Can you modify the code provided on given link.?
2 ビュー (過去 30 日間)
古いコメントを表示
My question is related with above link.
I want to replace the center pixel of a 3x3 window filter with the average of four neighbour pixels in 3 x 3 neighbourhood.
Can anyone modify code provided on that link..?
2 件のコメント
Geoff Hayes
2014 年 12 月 17 日
Nimisha - which four of the 3x3 neighbourhood do you wish to average? The ones at the north, south, east, and west of the centre pixel?
採用された回答
Thorsten
2014 年 12 月 17 日
編集済み: Thorsten
2014 年 12 月 17 日
Just convolve your data with the filter
F = [0 1 0; 1 0 1; 0 1 0]/4;
You can use imfilter for the convolution.
2 件のコメント
Geoff Hayes
2014 年 12 月 18 日
The error message is telling you that your inputs to conv must be vectors. You are passing matrices. Try using conv2 instead.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!