Frequency Domain Filtering Image Processing
Frequency Domain Filtering Image Processing
Lecture-5
Sankalp Kallakuri
[email protected]
Why Frequency Domain?
0
If
If D(u, v) D0
The Ideal Low Pass filter has very sharp transitions in frequency domain.
10 25 100 200
Cutoff Frequency
The frequency in ILPF transfer function at which there is a sharp transition
The total power enclosed in the frequency spectrum is
M 1 N 1
PT P(u, v)
u 0 v 0
The power that is enclosed within the circle is given by a fraction alpha
100 P(u, v) / PT
u v
Example
Do = 200
N=2
In Frequency Domain
Butterworth LPF
5 25 50
70 100 200
How can we obtain the spatial filter
components?
• The Frequency Domain filter is NxN
• The Spatial filter is nxn.
FT of NxN
FT of nxn
How can we obtain the spatial filter
components?
Reshape the matrices such that there is a matrix C
The error between the nxn and NxN mask convolution filter
Equating the error term to zero and taking the derivative we get
D 2 ( u ,v ) / 2 D0 2
H (u, v) e
5 25 50
70 100 200
High Pass Filters
1
If
If D(u, v) D0
Why should the center pixel of a High Pass Filter be 255 on a gray
level image?
Ideal HPF Example
50
100
Cutoff = 100
Gaussian HPF
50
100
Cutoff = 100
Laplacian in Frequency Domain
Effect of differentiation in the space domain
d n f ( x)
n ( ju ) n
F (u )
dx
2 f ( x, y ) 2 f ( x, y )
(u 2
v 2
) F (u, v)
x y
2 2 2 2
H (u, v) (u 2 v 2 )
Laplacian in Frequency Domain
The Laplacian operating on f(x,y) and its fourier transform
2 f ( x, y) 1 [(u M / 2) 2 (v N / 2) 2 ]F (u, v)
Laplacian HPF
g ( x, y) 1 1 ([(u M / 2) 2 (v N / 2) 2 )]F (u, v)
The Laplacian for composite filtering
H hp (u, v) 1 H lp (u, v)
g(x,y)
f(x,y)
Ln DFT H(u,v) IDFT exp
• Try to threshold Lena so that pixels that belong to her skin are
thresholded high. Display thresholded image (Figure F).
• Take the difference of the equalized image with the original. Display
the difference image (Figure J). Take the difference between
contrast stretched script and the original. Display the difference
image (Figure H). Compare the two images and comment.