This program reads the image of cameraman.
imnoise- adds salts and pepper noise to the read image
This can be removed using median filter.
x=imread('cameraman.tif');
y=imnoise(x,'salt & pepper',0.2);
I=find(x==0|x==255);
x1=medfilt2(x);
x2=x;
x2(I)=x1(I);
imshow([y x1 x2],[]);
No comments:
Post a Comment