Department of Computer Engineering, CMU
Chapter 4:
Image Enhancement in the
Frequency Domain
Lecturer: Wanasanan Thongsongkrit
Email : wanasana@[Link]
Office room : 410
Basic steps for filtering in the
frequency domain
1
Department of Computer Engineering, CMU
Basics of filtering in the
frequency domain
1. multiply the input image by (-1)x+y to center the
transform to u = M/2 and v = N/2 (if M and N are
even numbers, then the shifted coordinates will be
integers)
2. computer F(u,v), the DFT of the image from (1)
3. multiply F(u,v) by a filter function H(u,v)
4. compute the inverse DFT of the result in (3)
5. obtain the real part of the result in (4)
6. multiply the result in (5) by (-1)x+y to cancel the
multiplication of the input image.
Notch filter
• this filter is to force the F(0,0)
which is the average value of an
image (dc component of the
spectrum)
• the output has prominent edges
• in reality the average of the
displayed image can’t be zero as
it needs to have negative gray
levels. the output image needs to
scale the gray level
0 if (u, v) = (M/2, N/2 )
H (u, v) =
1 otherwise 4
2
Department of Computer Engineering, CMU
Low pass filter
high pass filter
Add the ½ of filter height to
F(0,0) of the high pass filter
3
Department of Computer Engineering, CMU
Correspondence between filter
in spatial and frequency domains
Smoothing Frequency-domain
filters: Ideal Lowpass filter
4
Department of Computer Engineering, CMU
image power circles
Result of ILPF
10
5
Department of Computer Engineering, CMU
Example
11
Butterworth Lowpass Filter:
BLPF
12
6
Department of Computer Engineering, CMU
Example
13
Spatial representation of BLPFs
14
7
Department of Computer Engineering, CMU
Gaussian Lowpass Filter: GLPF
15
Example
16
8
Department of Computer Engineering, CMU
Example
17
Example
18
9
Department of Computer Engineering, CMU
Example
19
Sharpening Frequency Domain
Filter:
Ideal highpass filter
0 if D(u, v) ≤ D 0
H (u, v) =
1 if D(u, v) > D 0
Butterworth highpass filter
1
H (u , v) =
1 + [D 0 D(u, v)]
2n
Gaussian highpass filter
2
( u ,v ) / 2 D02
H (u , v) = 1 − e − D
20
10
Department of Computer Engineering, CMU
Spatial representation of Ideal,
Butterworth and Gaussian highpass
filters
21
Example: result of IHPF
22
11
Department of Computer Engineering, CMU
Example: result of BHPF
23
Example: result of GHPF
24
12
Department of Computer Engineering, CMU
Laplacian in the Frequency
domain
25
Example: Laplacian filtered
image
26
13
Department of Computer Engineering, CMU
Example: high-boost filter
27
Examples
28
14
Department of Computer Engineering, CMU
Homomorphic Filter
29
Result of Homomorphic filter
30
15