image filtering with median need basic help
2 ビュー (過去 30 日間)
古いコメントを表示
Im trying to filter an image and remove surrounding noise, I need BASIC code which will help me do this. I have an image X, I separated X into three 2 dimensional arrays [R,G,B], Now i have the following
[nrows,mcols]=size(R);
for n=2:1:(nrows-1)
for m=2:1:(ncols-1)
I want to filter every value in each of the three matrices except for the ones in the corner, thus you will see my for statement starting 1 unit ahead and 1 unit behind on the other end. I want to filter each pixel like a tic tac toe. Each pixel is surrounded by 8 other pixels, I want to find the median of all the pixels including the middle one and then save the median and assign it to I dont know because my teacher never told us how to filter images. So yea...
0 件のコメント
回答 (2 件)
Image Analyst
2013 年 11 月 6 日
編集済み: Image Analyst
2013 年 11 月 6 日
% Call median filter function:
filteredImageR = medfilt2(redChannel, [7, 7]);
filteredImageG = medfilt2(greenChannel, [7, 7]);
filteredImageB = medfilt2(blueChannel, [7, 7]);
Also, see attached demo.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!