Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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 some denoising methods.

Noise sources

The main sources of noise in digital images are during the acquisition (quantity of photons collected too low, sensor temperature...) or during any transmission (echoes and atmospheric distortions in wireless communication). In some cases, noise is also considered to model the inaccuracies in the mathematical model of image formation, the latter being necessarily different compared to reality, like any physical model!

The noise is by nature a random phenomenon, it is modelled by a probability density which represents the intensity distribution of the noise.

In the following, we denote by yy the observed (and noisy) image, bb the noise and xx the non-noisy image.

Additive Gaussian white noise

Additive white Gaussian noise (AWGN, in French: bruit blanc gaussien additif) models each pixel (m,n)(m,n) of the observation yy by the sum of the pixel (m,n)(m,n) of the noiseless image xx and of a pixel of the noise bb:

∀ m,ny(m,n)=x(m,n)+b(m,n)\forall\, m,n \quad y(m,n) = x(m,n) + b(m,n)

where b(m,n)∼N(0,σ2)b(m,n) \sim \mathcal{N}(0,\sigma^2).

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 corresponding Poisson process has a mean equals to the illumination. The intensity of each pixel (m,n)(m,n) of the observation yy is:

∀ m,ny(m,n)∼P(x(m,n)).\forall\, m,n \qquad y(m,n) \sim \mathcal{P}\big(x(m,n)\big).

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).

∀ m,ny(m,n)={xminwith probability pmin,xmaxwith probability pmax,x(m,n)with probability 1 ⁣− ⁣pmin ⁣− ⁣pmax.\forall\, m,n \quad y(m,n) = \begin{cases} x_\mathrm{min} &\text{with probability}\,p_\mathrm{min}, \\ x_\mathrm{max} &\text{with probability}\,p_\mathrm{max}, \\ x(m,n) &\text{with probability}\,1\!-\!p_\mathrm{min}\!-\!p_\mathrm{max}. \end{cases}

where xminx_\mathrm{min} and xmaxx_\mathrm{max} 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:

Example of different types of noise (with almost the same power).

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 between the power of the non-noisy image over the power of the noise, where the power of an image xx is defined by:

Px=1M×N∑m,nx(m,n)2P_x = \frac{1}{M \times N} \sum_{m,n} x(m,n)^2

Because SNR is most often expressed on a logarithmic scale (unit: decibel), it is also defined as:

SNR=10log⁡10(∑m,nx(m,n)2∑m,nb(m,n)2)\text{SNR} = 10 \log_{10} \left( \frac{\sum_{m,n} x(m,n)^2}{\sum_{m,n} b(m,n)^2} \right)

For additive noise, another measure exists: the peak signal-to-noise ratio (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:

PSNR=10log⁡10(Δx  21M×N∑m,nb(m,n)2)\text{PSNR} = 10 \log_{10} \left( \frac{\Delta x^{\;2}}{\frac{1}{M \times N} \sum_{m,n} b(m,n)^2} \right)

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!

Noisy image at different RSB and PSNR.

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 (m,n)(m,n) of the denoised image x^\widehat{x} is the average of the pixels of the noisy image yy around (m,n)(m,n):

∀m, nx^(m,n)=1∣Vm,n∣∑(u,v)∈Vm,ny(u,v)\forall m,\,n \quad \widehat{x}(m,n) = \frac{1}{|V_{m,n}|} \sum_{(u,v)\in V_{m,n}} y(u,v)

where

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.

Effect of the size of the mean filter.

Figure 4:Effect of the size of the mean filter.

The mean filter can be expressed with a convolution product. Indeed, consider the case where the neighbourhood is a square of size N×NN\times N pixels, then the definition of the mean filter gives:

x^(m,n)=1N2∑(u,v)∈Vm,ny(u,v)=∑u,vg(m−u,n−v)y(u,v)\widehat{x}(m,n) = \frac{1}{N^2} \sum_{(u,v)\in V_{m,n}} y(u,v) = \sum_{u,v} g(m-u,n-v) y(u,v)

where

g(u,v)={1/N2if u∈{−N2,…,N2} and v∈{−N2,…,N2}0otherwiseg(u,v) = \begin{cases} 1/N^2 &\text{if}\, u\in\left\{-\frac{N}{2},\dots,\frac{N}{2}\right\} \,\text{and}\, v\in\left\{-\frac{N}{2},\dots,\frac{N}{2}\right\} \\ 0 &\text{otherwise} \end{cases}

This definition can be extended to any type of kernel gg! For example, Figure 5 gives the result for two different kernels.

Two mean filters with different kernels.

Figure 5:Two mean filters with different kernels.

In summary:

Median filter

The median of a set of numbers is the element mm of the set such that there are as many numbers smaller than mm as there are numbers larger than mm. For example, the median of {1, 2, 4, 8, 16}\{1,\,2,\,4,\,8,\,16\} is 4.

The median filter (French: filtre médian) is defined by:

∀m, nx^(m,n)=median({y(u,v)∣(u,v)∈Vm,n})\forall m,\,n \quad \widehat{x}(m,n) = \mathrm{median}\big(\{y(u,v) \mid (u,v)\in V_{m,n}\}\big)

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.

Comparison between a mean filter and a median filter, on an image with salt-and-pepper noise.

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.

Filtering a periodic noise on a photograph of the Moon:
the image is cleaned of periodic image artefacts.

Figure 7:Filtering a periodic noise on a photograph of the Moon: the image is cleaned of periodic image artefacts.

TV regularization

From a certain point of view, the goal of denoising is to obtain an image x^\widehat{x} not only with small variations in intensity between pixels but also close to the observation yy. 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 “criteria”).

The goal is then to find the image xx which minimizes both the data-fit and the regularization. Mathematically, one look for the image xx which minimizes E(x,y)+λR(x)E(x,y) + \lambda R(x), where λ\lambda is the “regularization parameter” (French: paramètre de régularisation) which is used to adjust the compromise between the two criteria. The value of λ\lambda is chosen by the user. Mathematically, we write:

x^=arg⁡min⁡xE(x,y)+λR(x)\widehat{x} = \arg\min_x E(x,y) + \lambda R(x)

This comes to an optimization problem, and there are a large number of algorithms to minimize E(x,y)+λR(x)E(x,y) + \lambda R(x). The choice and description of these algorithms are beyond the scope of the course.

Denoising with TV regularization, for two values of \lambda.

Figure 8:Denoising with TV regularization, for two values of λ\lambda.