Filtering#
The operation of filtering consists of applying a convolution with a specific PSF on an image so as to modify the image, or to enhance some features, or to reduce some frequencies.
In this section we will see some examples of filters. First, we begin with common filters (blur, edge detection and sharpening) that are defined from an analysis in the image domain. Then, we continue with two important families of filters: low-pass and high-pass filters, which are defined from considerations in the Fourier domain.
Blur filtering#
An example of blur filtering is given in Fig. 37. Each pixel of the output image is a mean of the pixel intensities in a window in the original image. The PSF in Fig. 37 is very simple:
Other size, shape, and coefficients can be used in the PSF as long as it defines a (possibly weighted) mean.
Edge detection filtering#
Edge detection consists of highlighting the borders of the “objects” in the image. This corresponds to compute the discrete derivatives of a pixel with its four neighbors, so that a specific pixel \((x,y)\) in the output image \(f\) is defined as (\(g\) is the original image):
Thus the PSF in this case is:
The result is given in Fig. 38.
Low-pass filtering#
Because filtering is the convolution of an image with a specific PSF, it can also be achieved by multiplying the DFT of the image and the DFT of the PSF. Then it becomes possible to define the filter in the Fourier domain instead of the spatial domain.
Fig. 40 shows an example of low-pass filtering. The first row shows the filtering as a convolution in the spatial domain, the second row shows the same information in the Fourier domain, where the DFT of the filtered image is the multiplication (point to point) of the DFT of the original image and the PSF.
Low-pass filtering preserves only the low frequencies, yielding a blurred image.
Similarly, the blur filter defined above is also a low-pass filter.
High-pass filtering#
Contrary to low-pass filtering, high-pass filtering preserves only the high frequencies, i.e. the sudden changes in the intensities (Fig. 41).
Similarly, the edge detection filter defined above is also a high-pass filter.