Title: filtering
1Frequency Domain Filtering (Chapter 4)
2Frequency Domain Methods
Frequency Domain
Spatial Domain
3Major filter categories
- Typically, filters are classified by examining
their properties in the frequency domain - (1) Low-pass
- (2) High-pass
- (3) Band-pass
- (4) Band-stop
4Example
Original signal
Low-pass filtered
High-pass filtered
Band-pass filtered
Band-stop filtered
5Low-pass filters(i.e., smoothing filters)
- Preserve low frequencies - useful for noise
suppression
Example
6High-pass filters(i.e., sharpening filters)
- Preserves high frequencies - useful for edge
detection
Example
7Band-pass filters
- Preserves frequencies within a certain band
Example
8Band-stop filters
Band-stop
Band-pass
9Frequency Domain Methods
Case 1 H(u,v) is specified in the frequency
domain. Case 2 h(x,y) is specified in the
spatial domain.
10Frequency domain filtering steps
F(u,v) R(u,v) jI(u,v)
11Frequency domain filtering steps (contd)
(case 1)
G(u,v) F(u,v)H(u,v) H(u,v) R(u,v)
jH(u,v)I(u,v)
12Example
fp(x,y)
f(x,y)
fp(x,y)(-1)xy
F(u,v)
G(u,v)F(u,v)H(u,v)
H(u,v) - centered
g(x,y)
gp(x,y)
13h(x,y) specified in spatial domainhow to
generate H(u,v) from h(x,y)?
- If h(x,y) is given in the spatial domain (case
2), - we can generate H(u,v) as follows
- Form hp(x,y) by padding with zeroes.
- 2. Multiply by (-1)xy to center its spectrum.
- 3. Compute its DFT to obtain H(u,v)
14Example h(x,y) is specified in the spatial domain
600 x 600
Important need to preserve odd symmetry (i.e.,
H(u,v) should be imaginary) (read details on
page 268)
Sobel
15Results of Filtering in the Spatial and
Frequency Domains
spatial domain filtering
frequency domain filtering
16Low-pass (LP) filtering
- Preserves low frequencies, attenuates high
frequencies.
ideal
in practice
D0 cut-off frequency
17Lowpass (LP) filtering (contd)
- In 2D, the cutoff frequencies lie on a circle.
18Specifying a 2D low-pass filter
- Specify cutoff frequencies by specifying the
radius of a circle centered at point (N/2, N/2)
in the frequency domain. - The radius is chosen by specifying the percentage
of total power enclosed by the circle.
19Specifying a 2D low-pass filter (contd)
- Typically, most frequencies are concentrated
around the center of the spectrum.
r8 (90 power)
r18 (93 power)
original
r radius
r43 (95)
r78 (99)
r152 (99.5)
20How does D0 control smoothing?
- Reminder multiplication in the frequency domain
implies convolution in the time domain
time domain
freq. domain
21How does D0 control smoothing? (contd)
- D0 controls the amount of blurring
r78 (99)
r8 (90)
22Ringing Effect
- Sharp cutoff frequencies produce an overshoot of
image features whose frequency is close to the
cutoff frequencies (ringing effect).
hfg
23Low Pass (LP) Filters
- Ideal low-pass filter (ILPF)
- Butterworth low-pass filter (BLPF)
- Gaussian low-pass filter (GLPF)
24Butterworth LP filter (BLPF)
- In practice, we use filters that attenuate high
frequencies smoothly (e.g., Butterworth LP
filter) ? less ringing effect
n1
n4
n16
25Spatial Representation of BLPFs
n1 n2 n5
n20
26Comparison Ideal LP and BLPF
BLPF
ILPF
D010, 30, 60, 160, 460
D010, 30, 60, 160, 460
n2
27Gaussian LP filter (GLPF)
28Gaussian Frequency Spatial Domains
spatial domain
frequency domain
29Example smoothing by GLPF (1)
30Examples of smoothing by GLPF (2)
D0100
D080
31High-Pass filtering
-
- A high-pass filter can be obtained from a
low-pass filter using
32High-pass filtering (contd)
- Preserves high frequencies, attenuates low
frequencies.
33High Pass (LP) Filters
- Ideal high-pass filter (IHPF)
- Butterworth high-pass filter (BHPF)
- Gaussian high-pass filter (GHPF)
- Difference of Gaussians
- Unsharp Masking and High Boost filtering
34Butterworth high pass filter (BHPF)
- In practice, we use filters that attenuate low
frequencies smoothly (e.g., Butterworth HP
filter) ? less ringing effect
35Spatial Representation of High-pass Filters
IHPF
BHPF
GHPF
36Comparison IHPF and BHPF
IHPF
D030,60,160
D030,60,160
BHPF
n2
37Gaussian HP filter
GHPF
BHPF
38Comparison BHPF and GHPF
D030,60,160
BHPF
n2
D030,60,160
GHPF
39Example High-pass Filtering and Thresholding
for Fingerprint Image Enhancement
BHPF (order 4 with a cutoff frequency 50)
40Difference of Gaussians Frequency Spatial
Domains
This is a high-pass filter!
41Difference of Gaussians Frequency Spatial
Domains (contd)
spatial domain
frequency domain
High-pass filter!
42Frequency Domain Analysis of Unsharp Masking and
Highboost Filtering
Unsharp Masking
Highboost filtering (alternative definition)
previous definition
Frequency domain
43Revisit Unsharp Masking and Highboost Filtering
Highboost Filter
44Highboost and High-Frequency-Emphasis Filters
45Example
GHPF
D040
High-emphasis
High-emphasis and hist. equal.
High-Frequency Emphasis filtering Using Gaussian
filter k10.5, k20.75
46Homomorphic filtering
- Many times, we want to remove shading effects
from an image (i.e., due to uneven illumination) - Enhance high frequencies
- Attenuate low frequencies but preserve fine
detail.
47Homomorphic Filtering (contd)
- Consider the following model of image formation
- In general, the illumination component i(x,y)
varies slowly and affects low frequencies mostly. - In general, the reflection component r(x,y)
varies faster and affects high frequencies mostly.
i(x,y) illumination r(x,y) reflection
IDEA separate low frequencies due to i(x,y)
from high frequencies due to r(x,y)
48How are frequencies mixed together?
- Low and high frequencies from i(x,y) and r(x,y)
- are mixed together.
- When applying filtering, it is difficult to
handle - low/high frequencies separately.
49Can we separate them?
Take the ln( ) of
50Steps of Homomorphic Filtering
- (1) Take
-
- (2) Apply FT
-
- or
- (3) Apply H(u,v)
51Steps of Homomorphic Filtering (contd)
- (4) Take Inverse FT
- or
- (5) Take exp( ) or
52Example using high-frequency emphasis
Attenuate the contribution made by illumination
and amplify the contribution made by reflectance
Attenuate the contribution made by illumination
and amplify the contribution made by reflectance
53Homomorphic Filtering Example
54Homomorphic Filtering Example