Professional Documents
Culture Documents
Chapter04 Filtering in Frequency Domain
Chapter04 Filtering in Frequency Domain
Processing
Image Filtering in the Frequency Domain
• Low Pass Filter
• High Pass Filter
• Band pass Filter
• Blurring
• Sharpening
2/16/2018 2
Frequency Bands
Image Fourier Spectrum
98%
99%
99.5% 99.9%
The Convolution Theorem
g=f*h g = fh
implies implies
G = FH G=F*H
Low pass Filter
g(x,y) G(u,v)
f(x,y) F(u,v)
g(x,y) H(u,v)
H(u,v) - Ideal Low Pass Filter
1 D(u,v) D0
H(u,v) =
0 D(u,v) > D0
D(u,v) = u2 + v2
D0 = cut off frequency
H(u,v)
H(u,v)
1
v
u 0 D0 D(u,v)
Blurring - Ideal Low pass Filter
Blurring - Ideal Low pass Filter
IFFT sinc(x)
H(u,v) h(x,y)
250
200
150
100
50
0
Spatial domain 0 50 100 150 200 250
The Spatial Representation of ILPF
Butterworth Lowpass Filter (BLPF)
Butterworth Lowpass Filters (BLPF) of order n and
with cutoff frequency D0
1
H (u, v)
1 D(u, v) / D0
2n
Butterworth Lowpass Filter (BLPF)
The Spatial Representation of BLPF
Gaussian Lowpass Filter (BLPF)
Gaussian Lowpass Filters (GLPF) in two dimensions is given
D 2 ( u , v )/2 2
H (u, v) e
D(u,v) = u2 + v2
By letting D0
D 2 ( u , v )/2 D02
H (u , v) e
H HP (u , v) 1 H LP (u , v)
BHPF
(order 4 with a cutoff
frequency 50)
2/16/2018 34
The Laplacian in the Frequency Domain
H (u , v) 4 2 (u 2 v 2 )
H (u , v) 4 2 (u P / 2) 2 (v Q / 2) 2 )
4 2 D 2 (u, v)
The Laplacian image
2 f ( x, y ) 1 H (u , v) F (u , v)
Enhancement is obtained
g ( x, y ) f ( x, y ) c 2 f ( x, y ) c -1
2/16/2018 35
The Laplacian in the Frequency Domain
1 1 4 2 D 2 (u, v) F (u, v)
2/16/2018 36
The Laplacian in the Frequency Domain
2/16/2018 37
Unsharp Masking, Highboost Filtering and High-
Frequency-Emphasis Fitering
g mask ( x, y ) f ( x, y ) f LP ( x, y )
f LP ( x, y ) 1 H LP (u , v) F (u , v)
g ( x, y ) 1 1 k * 1 H LP (u , v) F (u , v)
1 1 k * H HP (u, v) F (u, v)
2/16/2018 38
Unsharp Masking, Highboost Filtering and High-
Frequency-Emphasis Fitering
1
g ( x, y ) k
1 k2 * H HP (u , v) F (u , v)
k1 0 and k2 0
2/16/2018 39
High Pass Filtering
+
Original High Frequency Emphasis
Original High Frequency Emphasis
Gaussian Filter
D0=40
High-Frequency-Emphasis Filtering
Gaussian Filter
K1=0.5, k2=0.75
2/16/2018 45
Homomorphic Filtering
f ( x, y ) i ( x, y ) r ( x, y )
f ( x, y ) = i ( x, y ) r ( x, y ) ?
z ( x, y ) ln f ( x, y ) ln i ( x, y ) ln r ( x, y )
Z (u , v) Fi (u , v) Fr (u , v)
2/16/2018 46
Homomorphic Filtering
S (u , v) H (u, v) Z (u, v)
H (u , v) Fi (u , v) H (u , v) Fr (u , v)
s ( x, y ) 1 S (u , v)
1 H (u, v) Fi (u , v) H (u, v) Fr (u , v)
1 H (u, v) Fi (u , v) 1 H (u , v) Fr (u , v)
i '( x, y ) r '( x, y )
2/16/2018 47
Homomorphic Filtering
2/16/2018 48
Homomorphic Filtering
H (u , v) ( H L ) 1 e
c D 2 ( u , v )/ D02
L
2/16/2018 49
L 0.25
Homomorphic Filtering
H 2
c 1
D0 80
2/16/2018 50
Homomorphic Filtering
2/16/2018 51
Selective Filtering
Non-Selective Filters:
operate over the entire frequency rectangle
Selective Filters
operate over some part, not entire frequency rectangle
• bandreject or bandpass: process specific bands
• notch filters: process small regions of the frequency rectangle
2/16/2018 52
Selective Filtering:
Bandreject and Bandpass Filters
H BP (u , v) 1 H BR (u, v)
2/16/2018 53
Selective Filtering:
Bandreject and Bandpass Filters
2/16/2018 54
Selective Filtering:
Notch Filters
Zero-phase-shift filters must be symmetric about the origin.
A notch with center at (u0, v0) must have a corresponding notch
at location (-u0,-v0).
where H k (u, v) and H - k (u, v) are highpass filters whose centers are
at (uk , vk ) and (-uk , -vk ), respectively.
2/16/2018 55
Selective Filtering:
Notch Filters
Q
H NR (u, v) H k (u, v) H k (u, v)
k 1
where H k (u, v) and H - k (u, v) are highpass filters whose centers are
at (uk , vk ) and (-uk , -vk ), respectively.
2 1/2
D k (u , v) (u M / 2 uk ) (v N / 2 vk )
2
2/16/2018 56
Examples:
Notch Filters
(1)
A Butterworth notch
reject filter D 0 =3
and n=4 for all
notch pairs
2/16/2018 57
Examples:
Notch Filters (2)
2/16/2018 58
2/16/2018 59