image filtering with median need basic help
Afficher commentaires plus anciens
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...
Réponses (2)
Jhangir
le 6 Nov 2013
0 votes
Image Analyst
le 6 Nov 2013
Modifié(e) : Image Analyst
le 6 Nov 2013
% Call median filter function:
filteredImageR = medfilt2(redChannel, [7, 7]);
filteredImageG = medfilt2(greenChannel, [7, 7]);
filteredImageB = medfilt2(blueChannel, [7, 7]);
Also, see attached demo.
Catégories
En savoir plus sur Image Filtering dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!