Thursday, November 12, 2020

Noise Distributions

  

Noise present in  a scientific image can be described depending of its distribution. Thus, it is important to figure out how to define the type of noise in order to elaborate a strategy to denoise the images...

1- Impulse noise (or Salt and Pepper noise)

An impulse noise is characterized by extreme values - most of the time due to high-energy particles hitting the camera recording the image - and is rather easy to 

Create a new 8-bit image of 256x256 pixels entitled test with a background gray level equal to 128.0. Then, add the impulse noise (Process > Noise > Salt and Pepper).

Fig. 1: Salt and pepper image.


If you calculate the histogram, three peaks are available corresponding respectively to pixel values of 0 (the "pepper"), 128 (image background) and 255 (the "salt"). The fact that you only get extreme values (0 and 255 in a 8-bit image) is the signature of an impulse noise.


Note: We assume that we have an additive noise meaning that the pixels corresponding to the noise are added to the sample image.

2- Noise with a Gaussian Distribution

Gaussian noise is one of the most common noise found in scientific images. This type of noise is characterized by a probability density function (PDF) corresponding to a normal distribution.

 

Fig.2: Formula of the PDF pG of a random variable z (source Wikipedia).

2-1- Gaussian Noise

In ImageJ, there is a dedicated function for adding a Gaussian noise onto an image. Go to Process > Noise > Add noise. If you want to modify the standard deviation, use instead Process > Noise > Add specified noise....

Fig. 3: Gaussian noises added to the 8-bit test image with a 128.0 background with their corresponding histograms. Standard deviations of A) Default (25). B) 10 and C) 100.

The aspects of these noisy images are very different from the salt-and-pepper and it is easy to imagine that removing such a noise covering the whole dynamic range of the image will be more difficult than removing the extreme values of the impulse noise.

2-2- DIY Gaussian Noise

It is easy to generate your own Gaussian Noise. Let's do it!!

Create a 32-bit image with a black background and fill it with Process > Math > Macro... according to the following formula ...

v= v + sqrt(-2 * log(random()))*cos((2*PI) * random()) 

 ... then, compute the histogram. Et voilà! you have generated a bell curve with a mean of 0.0 and a standard deviation of 1.0 (Fig. 4).

Fig. 4: Histogram of the DIY Gaussian noise.

 

Note: The algorithm used to generate the gaussian noise is based on the Box-Muller transform [Wikipedia]. A discussion about the various possible implementations is here [Link].

If you want a Gaussian noise with a different standard deviation, just multiply this noisy 32-bit image by 25.0 (for comparison to the default Add Noise in ImageJ) in Process > Math > Multiply > 25.0, then add this noise to a 32-bit test image (with a background of 128.0) with the Image calculator (Process > Image Calculator...).

3- Other distributions

TODO 

Now, we know what the noise looks like, it is time to try to denoise these images...

Thank you for reading.



3. Other crazybiocomputing posts

Further readings are available in ...
  • Image Enhancement Series  [Link]
  • Image Processing TOC [Link]
  • Wikipedia about Kernel [Link]

No comments:

Post a Comment