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 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 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 corresponding pixels of the noiseless image xx and 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 mean of the Poisson process is proportional 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 of the power of the non-noisy image to 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

SNR is generally expressed on a logarithmic scale (unit: decibel), so:

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 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:

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 calculated as 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.
The neighbourhoods are squares of size L \times L, where L is given in the titles.

Figure 4:Effect of the size of the mean filter. The neighbourhoods are squares of size L×LL \times L, where LL 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 L×LL\times L pixels, then the definition of the mean filter gives:

x^(m,n)=1L2∑(u,v)∈Vm,ny(u,v)=∑u,vg(m−u,n−v)y(u,v)\widehat{x}(m,n) = \frac{1}{L^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/L2if u∈{−L2,…,L2} and v∈{−L2,…,L2}0otherwiseg(u,v) = \begin{cases} 1/L^2 &\text{if}\, u\in\left\{-\frac{L}{2},\dots,\frac{L}{2}\right\} \,\text{and}\, v\in\left\{-\frac{L}{2},\dots,\frac{L}{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. Figure 6 shows the result of a median filter, compared with a mean filter.

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

Actually, 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 criterion).

The objective is then to find the image xx that minimizes both the data-fit and the regularization. Mathematically, we seek the image xx that 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 controls the trade-off between the two criteria and is chosen by the user. Formally, this is written as:

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

The solution x^\hat{x} that minimizes E(x,y)+λR(x)E(x,y) + \lambda R(x) 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.

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

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