Noise Filtering

Work in progress. This note is still being written and incomplete.

3 min read Last updated Tue Aug 18 2026 07:21:39 GMT+0000 (Coordinated Universal Time)

Noise filtering identifies and reverses the effect of noise on an image, using properties of noise rather than direct observation, since only pixel values after corruption are visible.

Properties of noise:

  • Locality
    Noise affects isolated pixels, while image pixels are correlated locally, so noisy pixels stand out by examining local correlation.
  • Randomness
    Noise follows a probability distribution based on its source, allowing its level to be estimated.

Noise distribution models

  • Gaussian noise
    Unimodal with zero mean. Most pixels see zero or small noise. Most common model.
  • Uniform noise
    All noise levels equally probable. Difficult to estimate. Not common.
  • Salt and pepper noise
    Bi-modal with clipping. Affected pixels jump to extreme outlier values.

Frame averaging

For a static scene captured over nn frames, averaging corresponding pixels across frames cancels the noise contribution while preserving the scene.

Output=1ni=1nFramei=F+1ni=1nNi\text{Output} = \frac{1}{n}\sum_{i=1}^{n} \text{Frame}_i = F + \frac{1}{n}\sum_{i=1}^{n} N_i

Here:

  • FF: static source scene frame
  • NiN_i: noise in frame ii

Mean filter

Averages pixel values within a local neighbourhood. Since correlated image features vary slowly relative to sampling resolution, any local variation is assumed to be noise.

1mi=1mfi=P+1mi=1mNi\frac{1}{m}\sum_{i=1}^{m} f_i = P + \frac{1}{m}\sum_{i=1}^{m} N_i

As a convolution kernel:

19[111111111]\frac{1}{9}\begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{bmatrix}

Blurring

Local pixel variation is not always caused by noise. Averaging over genuine detail blurs it.

Weighted averages, with more weight on the pivot pixel, reduce blurring:

110[111121111]116[121242121]\frac{1}{10}\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 1 \\ 1 & 1 & 1 \end{bmatrix} \qquad \frac{1}{16}\begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 1 & 2 & 1 \end{bmatrix}

Gaussian filter

Weights arranged according to a 2-D Gaussian surface.

h(x,y)=exp[x2+y22σ2]h(x,y) = \exp\left[-\frac{x^2+y^2}{2\sigma^2}\right]

Conditional averaging

Reduces blurring by only replacing pixels where the local variation is likely to be noise.

  • Threshold averaging
    Replace the pixel with the local mean ml(x,y)m_l(x,y) only if the difference from the pivot is smaller than a threshold TT.
g(x,y)={ml(x,y)if f(x,y)ml(x,y)<Tf(x,y)otherwiseg(x,y) = \begin{cases} m_l(x,y) & \text{if } |f(x,y) - m_l(x,y)| < T \\ f(x,y) & \text{otherwise} \end{cases}
  • kk-closest averaging
    Select kMk \le M pixels with values closest to the pivot before averaging, avoiding outliers that represent real image features. Requires sorting pixel values.

Median filter

Replaces the pivot pixel with the median value of its neighbourhood.

  • Preserves edges better than mean filtering
  • Well suited to salt and pepper noise, since outlier values get discarded rather than averaged in
Was this helpful?