Matlab code for Filtering Noise present in the Image

a=imread(‘cameraman.tif’);

imshow(a);

b=imnoise(a,’salt & pepper’);

c=imnoise(a,’gaussian‘);

d=imnoise(a,’speckle‘);

figure

subplot(2,2,1);imshow(b);

subplot(2,2,2);imshow(c);

subplot(2,2,3);imshow(d);

h1=(1/9)*ones(3,3);

h2=(1/25)*ones(5,5);

b1=conv2(double(b),h1,’same’);

b2=conv2(double(b),h2,’same’);

figure

imshow(uint8(b1));

figure

imshow(uint8(b2));


Contact:
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com