Follow by Email

Lets Learn together... Happy Reading

" Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference "-Robert Frost

Adaptive filtering-local noise filter

Adaptive filter is performed on the degraded image that contains original image and noise. The mean and variance are the two statistical measures that a local adaptive filter depends with a defined mxn window region. 


%Add gaussian noise with mean 0 and variance 0.005
B = imnoise(B,'gaussian',0,0.005);
figure,imshow(B); title('Image with gaussian noise');

B= double(B);

%Define the window size mxn

%Pad the matrix with zeros on all sides

lvar=zeros([size(B,1) size(B,2)]);
lmean=zeros([size(B,1) size(B,2)]);
temp=zeros([size(B,1) size(B,2)]);
NewImg=zeros([size(B,1) size(B,2)]);

for i=1:size(C,1)-M-1
    for j=1:size(C,2)-N-1
             %Find the local mean and local variance for the local region        

%Noise variance and average of the local variance

%If noise_variance > local_variance then local_variance=noise_variance

 %Final_Image=B- (noise variance/local variance)*(B-local_mean);

 %Convert the image to uint8 format.
figure,imshow(NewImg);title('Restored Image using Adaptive Local filter');

like button Like "IMAGE PROCESSING" page


achu said... Reply to comment

Your site has been really useful to me for my project especially these posts but it would be really helpful if i'm cleared up with finding the Local Variance as you have given. I'm getting stuck there!
Pls reply.
Thank you!

coJetty said... Reply to comment

This is fake! The alogrithem convolves over the wrong indices and the so-called output image is not the one you get from copying the code 1:1. More likely it is the input image...mathematical background seems to be fine though. Some of the code is usable, but one has to correct it.

Aaron Angel said... Reply to comment

The code which I have provided here is for local noise. I have posted whatever result I obtained by executing the code, including the images. Kindly mail me your point of view more clearly. Happy Reading!

Sri said... Reply to comment


Unknown said... Reply to comment

Why is it necessary to do a 2 boarder zero padding for a 3X3 window? Shouldn't you have done just one layer of zero padding?

Benjamin Thornton said... Reply to comment

For your example above, why is it necessary to do a two layer zero padding if you are using a 3X3 window?

Enjoyed Reading? Share Your Views

Previous Post Next Post Home


Related Posts Plugin for WordPress, Blogger...
Google ping