Lecture

Filtering Frequency Domain

Fourier - Any periodic function can be rewritten as a weighted sum of infinite sinusoids of different frequencies.

Periodic - signal/function repeats its values in regular intervals/periods

Reasons why images may not be periodic:

  1. Limited to size
  2. There are unique content
  3. Edge limits

Fourier Series - any periodic function can be represented as the sum of sines and/or cosines of different frequencies.

Fourier Transform - functions are not periodic but have a finite area under the curve (represented using integral of sines and/or cosines of different frequencies).

  1. Low-pass filter: For a pass band, you multiply by 1; for a reject band, you multiply by 0. Passband goes first, then stopband goes next -|_

NOTE: only allows low frequencies.

  1. High-pass filter: For a pass band, you multiply by 0; for a reject band, you multiply by 1. Stopband goes first, then passband goes next _|-

Basically the same thing as low-pass, but the order of which the bands are arranged are different.

  1. Bandreject filter: Passband -> Stopband -> Passband -_-

  2. Bandpass filter: Stopband -> Passband -> Stopband -

REMEMBER: to smooth an image, you use a low-pass filter. if you want to sharpen an image, then you use a high-pass filter

The Process of Frequency Domain Filtering

There are two processes for Frequency Domain Filtering:

  1. Spatial to Frequency
  2. Frequency to Spatial

Spatial Domain -> Discrete Fourier Transform -> Frequency Domain

Frequency Domain -> Inverse Discrete Fourier Transform -> Spatial Domain

Image in Spatial Domain -> Pre-processing -> Fourier Transform -> Frequency Domain Processing -> Inverse Fourier Transform -> Post-processing -> Enhanced Image

Steps for Filtering in the Frequency Domain

  1. Given an input image of size M x N, get the padding size P and Q, where P = 2M and Q = 2N

Different Low-pass Filters in Frequency Domain

  1. Ideal LPF (sharp cutoff)
  2. Butterworth LPF (Order parameter)
  3. Gaussian LPF (smooth transition)

Ideal LPF: A 2D filter which passes w/o the reduction of amplitude within a circle of specified radius from the origin, and cuts off.

Equation: $H(u,v) = \begin{cases} 1 &\text{if } D(u,v) \leq D_0 \ 0 &\text{if } D(u,v) > D_0 \end{cases}$

NOTE: IT IS IMPORTANT TO REMEMBER THE EQUATIONS FOR EACH FILTER (like the example above) QUIZ ON MARCH 18

Cons for having a Low-pass filter:

Applications for Low-pass filtering: 1. 2.

Image Sharpening Using Highpass Frequency Filters For a highpass filter, you simply just subtract the lowpass filter transfer function from 1. This would yield the corresponding highpass filter transfer function in the frequency domain.

Deriving a spatial filter

Look up why high-pass filters are recommended for edges.

For image segmentation, look at chapter 10 and 11

Reading

Summary