coe4tn3 image processing
TRANSCRIPT
CoE4TN3Image Processing
Chapter 4Image Enhancement in
Frequency Domain
2
Fourier Transform • Fourier Transform (FT) of a 2-D signal:
1 1
0 0
1 1
0 0
1
2 2 1/ 2
1( , ) ( , ) exp( 2 ( / / )
( , ) ( , ) exp( 2 ( / / ))
( , ) ( , ) ( , )( , )( , ) tan [ ]( , )
( , ) [ ( , ) ( , )]( , ) ( , )
M N
x y
M N
u v
F u v f x y j xu M yv NMN
f x y F u v j xu M yv N
F u v R u v jI u vI u vu vR u v
F u v R u v I u vF u M v N F u v
π
π
φ
− −
= =
− −
= =
−
= − +
= +
= +
=
= +
+ + =
∑ ∑
∑ ∑
3
Fourier Transform • Properties of Fourier Transform (FT) of a 2-D real, signal:
1 1
0 0
*
*
1(0,0) ( , )
( , ) ( , )( , ) ( , )( , ) ( , )
M N
x yF f x y
MNF u v F u vF u v F M u N vF u v F u v
− −
= ==
= − −
= − −
= − −
∑ ∑
4
Fourier Transform • It is common to multiply input image by (-1)x+y prior to
computing the Fourier Transform.
• This shift the center of the FT to (M/2,N/2)
5
Fourier Transform
6
Frequency domain filtering 1. Multiply the input image by (-1)x+y to center the transform
Compute the DFT of the image from step 12. Multiply the result by the transfer function of the filter
(centered)3. Take the inverse transform.4. Multiply the result by (-1)x+y
7
Frequency domain filtering • G(u,v)=F(u,v)H(u,v)• Based on convolution theorem: g(x,y)=h(x,y)*f(x,y)
– f(x,y) is the input image– g(x,y) is the processed image– h(x,y): impulse response or point spread function
• Based on the form of H(u,v), the output image exhibits some features of f(x,y)
8
Frequency domain filtering
f(x,y)h(x,y)
Convolution
1) Flip 2) Shift, multiply, add
f(x,y)w(x,y)
Implementing a mask
9
Frequency domain filtering• Convolution with a filter and implementing a mask are very
similar• The only difference is the flipping operation• If the impulse response of the filter is symmetric about the
origin the two operations are the same.• Instead of filtering in the frequency domain, we can
approximate the impulse response of the filter by a mask, and use the mask in the spatial domain.
10
11
Frequency domain filtering
• Edges and sharp transitions (e.g., noise) in the gray levels of an image contribute significantly to high-frequency content of FT.
• Low frequency in the Fourier transform of an image are responsible for the general gray-level appearance of the image over smooth areas.
• Blurring (smoothing) is achieved by attenuating range of high frequency components of FT.
• We consider 3 types of lowpass filters: ideal, Butterworth and Gaussian
12
Ideal low-pass filter• Ideal: all the frequencies inside a circle of radius D0 are
passed and all the frequencies outside this circle are completely removed.
=01
),( vuH0),( DvuD ≤
0),( DvuD >
uv
2 2 1/ 2( , ) [( / 2) ( / 2) ]D u v u M v N= − + − |H||H|
D(u,v)M/2+D0M/2-D0
13
14
15
Ideal low-pass filter• Effects of ideal low-pass filtering: blurring and ringing
16
Ideal low-pass filter
• The radii of the concentric rings in h(x,y) are proportional to 1/D0
D0 1/D0 Less blurring, Less ringing (amplitude of rings drop)
D0 1/D0 More blurring, More ringing (amplitude of rings increase)
17
Butterworth Lowpass Filters• Smooth transfer function, no sharp discontinuity, no clear
cutoff frequency.
n
DvuD
vuH 2
0
),(1
1),(
+
=
21
18
Butterworth Lowpass Filters
19
Butterworth Lowpass Filters
20
• Smooth transfer function, smooth impulse response, no ringing
02
2
2),(
),( DvuD
evuH−
=
Gaussian Lowpass Filters
21
Gaussian Lowpass Filters
22
Applications of Lowpass Filters
23
Applications of Lowpass Filters
24
High-pass filtering• Image sharpening can be achieved by a high-pass filtering
process.• Hhp(u,v)=1-Hlp(u,v)
• Ideal:
• Butterworth:
• Gaussian:
n
vuDD
vuH 20
2
),(1
1|),(|
+
=
=01
),( vuH0),( DvuD >
0),( DvuD ≤
20
2 2/),(1),( DvuDevuH −−=
25
High-pass filtering
26
High-pass filtering
27
High-pass filtering
28
High-pass filtering
29
High-pass filtering
30
Laplacian in Frequency Domain
)(1),(),()(),(),(
),(),(),(
)(),(
),()(]),(),([
222
22
2
221
222
2
2
2
vuvuHvuFvuvuFvuG
yxfyxfyxg
vuvuH
vuFvuyyxf
xyxf
++=
++=
∇−=
+−=
+−=∂
∂+
∂∂
ℑ
31
Laplacian in Frequency Domain
32
33
Unsharp Masking, High-boost Filtering• Unsharp masking: fhp(x,y)=f(x,y)-flp(x,y)• Hhp(u,v)=1-Hlp(u,v)
• High-boost filtering: fhb(x,y)=Af(x,y)-flp(x,y)• fhb(x,y)=(A-1)f(x,y)+fhp(x,y)• Hhb(u,v)=(A-1)+Hhp(u,v)
34
Unsharp Masking, High-boost Filtering
35
Homomorphic filtering• In some images, the quality of the image has reduced because
of non-uniform illumination• Homomorphic filtering can be used to perform illumination
correction• We can view an image f(x,y) as a product of two components:
• This equation cannot be used directly in order to operate separately on the frequency components of illumination and reflectance
( ) ( ) ( )yxryxiyxf ,,, ⋅=
36
( ) ( ) ( )( )( ) ( )vuFvuHvuFvuHvuSvuZvuHvuSvuFvuFvuZ
ri
ri
,),(,),(),(,),(),(
,,,
+==
+=
( ) ( ) ( ) ( )yxryxiyxfyxz ,ln,ln,ln, +==
),(),(),(
),(),(),(
00),(),(),(
''
''
yxryxieeeyxg
yxryxiyxsyxryxiyxs ===
+=
Homomorphic filtering
37
• The key to the approach is that separation of the illumination and reflectance components is achieved. The homomorphicfilter can then operate on these components separately
• Illumination component of an image generally has slow variations, while the reflectance component vary abruptly
• By removing the low frequencies (highpass filtering) the effects of illumination can be removed
Homomorphic filtering
38
Homomorphic filtering
39
40
41
42
43