
%I = imread('MRInoise.png'); 
I = imread('noisyimage3.jpg');
I=rgb2gray(I);

%Define low pass filter
w=1/9*ones(5);
%Apply a simple filter
Ism=filter2(w,I);
%figure, imshow(uint8(Ism))
%This is the median filter
J = imsmooth(I, 'Median' , [5 5]);
%This is the P&M anisotropic diffusion
K = imsmooth(I, 'Perona and Malik' , 20);
subplot(2,2,1), imshow(I,[]),title('Initial Image');
subplot(2,2,2), imshow(uint8(Ism),[]),title('Smooth image');
subplot(2,2,3), imshow(K,[]),title('Perona filtering image');
subplot(2,2,4), imshow(J,[]),title('Median filtering image');

