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. |
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
This is satisfied if the sum of the coefficents in the filter is unity.
This is satisfied if the filter contains no negative elements
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 (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.
Repeated convolutions can be grouped together by the law of associativity.
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.
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 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.
Maintained by John Loomis, last updated June 14, 1997