Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove gaussian noise from an image in MATLAB?

I'm trying to remove a Gaussian noise from an image. I've added the noise myself using:

nImg = imnoise(img,'gaussian',0,0.01);

I now need to remove the noise using my own filter, or at least reduce it. In theory, as I understand, using a convolution matrix of ones(3)/9 should help and using a Gaussian convolution matrix like [1 2 1; 2 4 2; 1 2 1]/9 or fspecial('gaussian',3) should be better. Yet, they really don't do the trick so well: enter image description here

Am I missing something important? I need to use convolution, by the way.

like image 641
shwartz Avatar asked Dec 23 '11 17:12

shwartz


People also ask

How do I remove Gaussian noise from a picture?

Removing Gaussian noise involves smoothing the inside distinct region of an image. For this classical linear filters such as the Gaussian filter reduces noise efficiently but blur the edges significantly.

Which filter is preferred to remove Gaussian noise?

The Median filter is a nonlinear digital filtering technique, often used to remove noise.

How do I get rid of the salt and pepper noise in Matlab?

Use the Median Filter block to eliminate the black and white speckles in the image. Use the default parameters. The Median Filter block replaces the central value of the 3-by-3 neighborhood with the median value of the neighborhood. This process removes the noise in the image.

How does Matlab define Gaussian noise?

Description. y = awgn( x , snr ) adds white Gaussian noise to the vector signal x . This syntax assumes that the power of x is 0 dBW.


1 Answers

You are not missing anything! Obviously, you can't remove the noise completely. You can try different filters, but all of them will have a tradeoff:

More Noise + Less blur VS Less Noise + More blur

It becomes more obvious if you think of this in the following way:

Any convolution based method assumes that all of the neighbors have the same color.

But in real life, there are many objects in the image. Thus, when you apply the convolution you cause blur by mixing pixels from different adjacent objects.

There are more sophisticated denoising methods like:

  • Median denoising
  • Bilateral filter
  • Pattern matching based denoising

They are not using only convolution. By the way, even they can't do magic.

like image 105
Andrey Rubshtein Avatar answered Sep 20 '22 17:09

Andrey Rubshtein