17.8. Frequency Domain Filters

Whereas convolution is used to evaluate filters in the spatial domain, filtering is implemented in the frequency domain by multiplication. The image in the frequency domain is multiplied by the filter’s frequency response in the frequency domain. Thus, the filter transfer function is simply a matrix of the same size as the image. The complex values of the image in the frequency domain are simply multiplied element by element with the filter transfer function to amplify or attenuate specific frequencies of the image. The inverse Fourier transform is then used to generate the output image.

../_images/freq-filter.png

For each filtering operation, we will describe the construction three types of filters in the frequency domain.

ideal filters

Ideal filters are quick and easy to implement and give an easy to understand appreciation of the filter. Unfortunately, ideal filters typically yield undesired results. Specifically, ideal filters suffer from a problem known as ringing where extra lines appear around the edges of objects in an image. (see What Causes Ringing?)

Gaussian filters

The shape of a Gaussian filter transfer function is that of the bell-shaped curve that models the probability distribution function of a normal or Gaussian stochastic process. The smooth transition between the pass-band and stop-band produces good results with no noticeable ringing artifacts. The cutoff frequency of Gaussian filters is determined by a variable (\sigma).

Butterworth filters

The shape of a Butterworth filter transfer function is tunable. The order of the filter (n) determines the steepness of the transition between the pass-band and stop-band. It can assume a gentle transition like that seen in Gaussian filters, or it can assume an abrupt transition like ideal filters. A nice aspect of Butterworth filters is that the cutoff frequency is a parameter of transfer function equation. Thus, it is simpler to determine the parameters from examining the image in the frequency domain.

17.8.1. Filter Parameters

Distance Function

To generate filter transfer functions, it is necessary to know the distance of each element of the transfer function to the origin (0,0). In the filter transfer function equations, this distance to the origin is denoted as D(u,v), or simply as D. Since the frequency domain data ranges from 0 to 2 \dot \pi in both the horizontal and vertical direction, rather than between -\pi and \pi), it is convenient to use a special function to calculate the distances. A function to build a matrix of these distances is included with the MATLAB code for completing the tutorials.

Cutoff Frequency

The transition point between the pass and stop bands of the filter is denoted as D_0.

Band Width

For band-reject and band-pass filters, where the data between lower and upper cutoff frequencies is either rejected or passed, the width is denoted as W.

17.8.2. Low-Pass Filters

Low pass filters remove higher frequencies, thus blurring some image content.

ideal low-pass filter

H_{IL}(u,\,v) = \left\{\begin{array}{ll}
1 & \mbox{if } D(u,\,v) \leq D_0 \\
0 & \mbox{if } D(u,\,v) > D_0
\end{array}\right.

Gaussian low-pass filter

H_{GL}(u,\,v) = e^{-(D(u,v)^2)/\,2\sigma^2}

Butterworth low-pass filter

H_{BL}(u,\,v) = \frac{1}{1 + \left[ D(u,v)/\,D_0 \right]^{2n}}

17.8.3. High-Pass Filters

The concept of high-pass filtering is to remove lower frequency content while keeping higher frequencies. With image processing, this, by it self, yields undesirable results. Particularly, removing the overall brightness represented at position (0, 0) of the image in the frequency domain is not desired. Thus, to preserve the low-frequency content while emphasising the high-frequency content we alter the transfer function with a high-frequency emphasis equation.

H_{hfe}(u,\,v) = a + b\,H(u,\,v)

A value of one for both a and b is common.

ideal high-pass filter

H_{IH}(u,\,v) = \left\{\begin{array}{ll}
0 & \mbox{if } D(u,\,v) \leq D_0 \\
1 & \mbox{if } D(u,\,v) > D_0
\end{array}\right.

Gaussian high-pass filter

H_{GH}(u,\,v) = 1 - e^{-(D(u,v)^2)/\,2\sigma^2}

Butterworth high-pass filter

H_{BH}(u,\,v) = \frac{1}{1 + \left[ D_0/\,D(u,v) \right]^{2n}}

17.8.4. Band-reject Filters

Band-reject and Band-Pass filters are used less in image processing than low-pass and high-pass filters.

Band-reject filters (also called band-stop filters) suppress frequency content within a range between a lower and higher cutoff frequency. The parameter D_0 here is the center frequency of the reject band.

ideal band-reject filter

H_{IBR}(u,\,v) = \left\{\begin{array}{ll}
0 & \mbox{if } D_0 - W/2 \leq D(u,v) \leq D_0 + W/2 \\
1 & \mbox{otherwise}
\end{array}\right.

Gaussian band-reject filter

H_{GBR}(u,\,v) = 1 -
e^{-\left(\frac{D(u,v)^2 - {D_0}^2}{D(u,v)\,W}\right)^2}

Butterworth band-reject filter

H_{BBR}(u,\,v) = \frac{1}{1 + \left[\frac{D(u,v)\,W}
{D(u,v)^2 - {D_0}^2} \right]^{2n}}

17.8.5. Band-Pass Filters

A band-pass filter is the opposite of a band-reject filter. It only passes frequency content within a range. A band-pass filter is obtained from a band-reject filter as:

H_{BP}(u,\,v) = 1 - H_{BR}(u,\,v)