Many useful image processing operations may be implemented by filtering the image with a selected filter. Digital Image Processing defines a large number of smoothing, sharpening, noise reduction, and edge filters. Additional filters may be easily added or designed using the filter design functionality of the package.

<< ImageProcessing`

Linear filtering

BoxFilter, GaussianFilter, and SmoothingFilter are all variants of so-called smoothing filters. They produce a response that is a local (weighed) average of the samples of a signal.

The Savitzky-Golay smoothing filter is an optimal filter that returns the best average value, in the sense of least squares, of a neighborhood of image points. It is a good general-purpose smoothing filter. Here we show the coefficients of a Savitzky-Golay filter of order three and length five.

SmoothingFilter[5, 3, 5, 3] // MatrixForm

This loads an example image and computes a smoothed copy using the filter shown above.

A = ImageRead["chart.tif"];
B = 
        DiscreteConvolve[A, SmoothingFilter[5, 3, 5, 3], 
          Centered -> True];

Here we display the two images.

Show[
        GraphicsArray[Graphics[#1, Frame -> True, 
                FrameTicks -> None] & /@ {A, 
              ScaleClip[B, {0. , 255. }] }]];