Smoothing Filters

Smoothing Filters

Smoothing filters are used to enhance noisy images (at the expense of blurring). This filter generates the average over a 3 x 3 area of the image. The technique is also called moving window averaging.

Example of smoothing

The image on the right is a smoothed version of the image on the left. The red, green, and blue components were filtered separately.

The text file describing the filter used had the following contents:

3 x 3 equal-weight average
size 3 3
1 1 1
1 1 1
1 1 1
9

Desired properties for smoothing filters

Odd filter size preferred

Filters with odd numbers of rows and columns are preferred because there is a unique central position

Filters with even numbers of rows and columns can be embedded in an odd size matrix.
Eliminating the zero rows and columns makes the filter more efficient, but its interpretation is now ambiguous. There are four ways the 3 x 3 filter above can be written and produce the same 2 x 2 filter.

Linear combinations of filtered images

Linear combinations of filtered images (including the original image) may be used to vary the final effect.

Linear interpolation between two images is called alpha blending.

Filters can be blended, rather than the resulting images, because the convolution operation is linear.

Example of blended filter

Repeated convolution

Repeated convolutions can be grouped together by the law of associativity.

Example

Separable filters

Separable filters can be represented as a product of row and column vectors as shown below.

This construction can be understood as a matrix product, a convolution, or as the outer product of two vectors.

[ 1 n 1 ] filters

The [ 1 2 1 ] filter can be constructed from the relative sizes of the areas shown in yellow on the right. The final effect is a uniform weight over a 2 x 2 pixel area.

Binomial filters

Binomial filters are generated by application of the binomial expansion.

Each term of the expansion (with p = q = 1/2) corresponds to an element in the filter. A fourth-order one-dimensional filter, for example, produces

Two-dimensional filters are produced by taking the outer product of the one-dimensional vectors, as described earlier.

Example filter (4th order)


Maintained by John Loomis, last updated June 14, 1997