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:
- Limited to size
- There are unique content
- 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).
- 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.
- 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.
-
Bandreject filter: Passband -> Stopband -> Passband -_-
-
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:
- Spatial to Frequency
- 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
- 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
- Ideal LPF (sharp cutoff)
- Butterworth LPF (Order parameter)
- 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