Denoising (French: débruitage) consists in reducing noise in an image. Note that it is often not possible to completely cancel the noise. We start this section by listing the most common noise models, then we present four denoising methods: mean filter, median filter, periodic noise filtering, and TV regularization.
Noise sources¶
The main sources of noise in digital images arise during image acquisition (e.g. low photons counts or high sensor temperature) or transmission (e.g. echoes and atmospheric distortions in wireless communication). In some cases, noise also models the inaccuracies in the mathematical model of image formation, since a mathematical model is always an approximation of the reality.
Because the noise is by nature a random phenomenon, it is modelled by a probability density function describing the intensity distribution of the noise.
In the following, we denote the observed (and noisy) image, the noise, and the non-noisy image.
Additive Gaussian white noise¶
Additive white Gaussian noise (AWGN, in French: bruit blanc gaussien additif) models each pixel of the observation by the sum of the corresponding pixels of the noiseless image and the noise :
where .
This model is simple and facilitates calculations. It is used in most applications, including photography.
Poisson Noise¶
Poisson noise (also called shot noise, in French: bruit de Poisson) models the acquisition of photons on a photosite. The number of photons is random and depends on the illumination. The mean of the Poisson process is proportional to the illumination. The intensity of each pixel of the observation is:
This model is used in the case of acquisitions with a low number of photons, for example in astronomy.
Salt-and-pepper noise¶
Salt-and-pepper noise (French: bruit poivre et sel), also called less poetically impulse noise, models saturated or dead pixels (due to photosite malfunction or saturation).
where and are the intensity minimum and maximum.
Noise power¶
Figure 2 illustrates the effect of the previous noises on the same image. One can observe that:
for Gaussian noise, the whole image is affected in the same way by the noise,
for Poisson noise, the lighter parts are noisier than the dark parts,
for impulse noise, only a few pixels are modified and they are replaced by black or white pixels.
Figure 2:Example of different types of noise (with almost the same power).
Signal-to-noise ratio (SNR, in French: RSB for rapport signal-sur-bruit) is a measure of the noise level. It is defined as the ratio of the power of the non-noisy image to the power of the noise, where the power of an image is defined by:
SNR is generally expressed on a logarithmic scale (unit: decibel), so:
For additive noise, another measure exists: the so-called peak signal-to-noise ratio (PSNR). PSNR is the ratio of the squared dynamics of the non-noisy image (difference between maximum intensity and minimum intensity) to the power of the noise:
Figure 3 represents the same image corrupted with additive white Gaussian noise, at different SNR and PSNR. As you can see, when the RSB or the PSNR increases, the noise decreases!
Figure 3:Noisy image at different RSB and PSNR.
Mean filter¶
The mean filter (French: filtre moyenneur) is a very simple denoising method. Each pixel of the denoised image is calculated as the average of the pixels of the noisy image around :
where
is the neighbourhood, that is the set of pixels around ;
is the cardinality of , that is, the number of pixels in the neighbourhood.
Figure 4 illustrates the effect of the mean filter for different sizes of the neighbourhood. If the neighbourhood grows, then the noise decreases but at the same time the image becomes more blurry.
Figure 4:Effect of the size of the mean filter. The neighbourhoods are squares of size , where is given in the titles.
The mean filter can be expressed with a convolution product. Indeed, consider the case where the neighbourhood is a square of size pixels, then the definition of the mean filter gives:
where
This definition can be extended to any type of kernel . For example, Figure 5 gives the result for two different kernels.
Figure 5:Two mean filters with different kernels.
In summary:
the mean filter calculates the average of the pixels in a neighbourhood,
the mean filter can be written as a convolution,
the noise is reduced by averaging the intensities but the image is blurred.
Median filter¶
The median of a set of numbers is the element of the set such that there are as many numbers smaller than as there are numbers larger than . For example, the median of is 4.
The median filter (French: filtre médian) is defined by:
The median filter is excellent for denoising an image in the case of salt-and-pepper noise because it does not blur the image, as a mean filter would do.
Despite its name, the median filter is not a filter because it does not respect the linearity property. Therefore it cannot be written as a convolution. Figure 6 shows the result of a median filter, compared with a mean filter.
Figure 6:Comparison between a mean filter and a median filter, on an image with salt-and-pepper noise.
Periodic noise filtering¶
Periodic noises are characterized by structures in the Fourier transform. These structures can be removed in the Fourier domain by cancelling the coefficients using a mask. The denoised image is then obtained by an inverse Fourier transform.
Figure 7:Filtering a periodic noise on a photograph of the Moon: the image is cleaned of periodic image artefacts.
TV regularization¶
Actually, the goal of denoising is to obtain an image not only with small variations in intensity between pixels but also close to the observation . TV regularization (total variation, French: variation totale) [Rudin et al. 1992, Chambolle 2004] is a denoising method that describes these two objectives by mathematical functions (the so-called criterion).
The wish to have a denoised image close to the observation results in a “data-fit” criterion (French: critère d’adéquation aux données) which measures the difference between and . A common choice is the least-squares criterion (equivalent to a mean square error):
Thus, decreasing requires finding an image that closely matches ."
The desire to have an image with small variations in intensity results in a “regularization” criterion (French: critère de régularisation) which measures the difference between the neighbouring pixels of . A simple choice is total variation:
Thus, reducing requires small intensity differences between neighboring (horizontal or vertical) pixels. This implies that the image must have nearly uniform intensity.
The objective is then to find the image that minimizes both the data-fit and the regularization. Mathematically, we seek the image that minimizes , where is the “regularization parameter” (French: paramètre de régularisation) which controls the trade-off between the two criteria and is chosen by the user. Formally, this is written as:
The solution that minimizes does not admit a closed-form expression. So we face to an optimization problem, for which numerous algorithms exist. The choice and description of these algorithms are beyond the scope of the course.
Finally, an example of TV regularization is given Figure 8.
Figure 8:Denoising with TV regularization, for two values of .