DIP Chapter 4 Filtering in the Frequency Domain M2
DIP Chapter 4 Filtering in the Frequency Domain M2
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Extension to 2D
��
δ(tt0−, zt0 ,−
z−
∞∞ for tt ==t0t,0z, z==
z0 z0
δ(t − z0z)0=
)=
�
00 otherwise
otherwise
∞ for t = t0 , z = z0
� ∞ � ∞ δ(t − t0 , z − z0 ) =
δ(t − t0 , z − z0 )dtdz = 1
0 otherwise
−∞ −∞
� ∞ � ∞
� ∞ � ∞ δ(t − t0 , z − z0 )dtdz = 1
−∞ −∞
f (t, z)δ(t − t0 , z − z0 )dtdz = f (t0 , z0 )
−∞ −∞
Sifting: � ∞ � ∞
f (t, z)δ(t − t0 , z − z0 )dtdz = f (t0 , z0 )
−∞ −∞
1 1
∆T < , ∆Z <
2µmax 2νmax
nsforms:
M
� −1 N
�
© 1992–2008 R. C. Gonzalez & R. E. Woods
−1
δ(t − t0 ,Digital
z − z0Image
)dtdzProcessing,
=1 3rd ed.
−∞ −∞
Gonzalez & Woods
www.ImageProcessingPlace.com
� ∞ � ∞
f (t, z)δ(t − t0 , z − z0 )dtdzChapter
= f (t4
0 , z0 )
−∞ −∞ Filtering in the Frequency Domain
� ∞ � ∞
−j2π(µt+νz)
F (µ,
Forν)the f (t,
= rectangular z)e the transform
impulse, dtdz is a tensor product of two
−∞ −∞
sinc functions
� ∞ � ∞
f (x, y) = F (µ, ν)e−j2π(µt+νz) dµdν
−∞ −∞
� ∞ � ∞ Chapter 4
Filtering in the Frequency Domain
f (t, z)δ(t − t0 , z − z0 )dtdz = f (t0 , z0 )
−∞ −∞
� ∞ � ∞
−j2π(µt+νz)
DiracFcomb = spike mat f (t, z)e
(µ, ν)->
−∞ −∞
dtdz
� ∞ � ∞
f (x, y) = F (µ, ν)e−j2π(µt+νz) dµdν
−∞ −∞
Chapter 4
(t, z)δ(tin −
fFiltering t0 , z − z0 )dtdz
the Frequency Domain
= f (t0 , z0 )
−∞ −∞
� ∞ � ∞
F (µ, ν) = f (t, z)e−j2π(µt+νz) dtdz
We say that f(t,z) is band−∞
limited
−∞ if the transform F(µ,v) =0 outside
� ∞ � ∞
the rectangle [-µmax, µmax] and [-vmax, v−j2π(µt+νz)
max]
f (x, y) = F (µ, ν)e dµdν
−∞ −∞
1 1
∆T < , ∆Z <
2µmax 2νmax
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
m=−∞
s∆T ∆Z (t, z) = Chapter 4 n=−∞ δ(t − m∆T, z − n∆Z)
Filtering in the Frequency
m=−∞ 1 n=−∞Domain 1
∆T < , ∆Z <
2µ1 max 1 max
2ν
∆T < , ∆Z <
Discrete transforms: 2µmax 2νmax
Discrete transforms: M −1 N −1
� �
−j2π(ux/M +vy/N )
F (u, v) =M� −1 N �−1 f (x, y)e
−j2π(ux/M +vy/N )
F (u, v) = x=0 y=0f (x, y)e
x=0 y=0
Inverse discrete transform:
Inverse discrete transform: M −1 N −1
1 � �
−j2π(ux/M +vy/N )
f (x, y) = 1 M� −1 N
� −1 F (u, v)e
f (x, y) = M N u=0 v=0F (u, v)ej2π(ux/M +vy/N )
M N u=0 v=0
Chapter 4
F (uFiltering
+ k1 M, v +Frequency
in the k2 N ) =Domain
F (u, v)
f (x + k1 M, y + k2 N ) = f (x, y)
Note that jφ(u,v)
F (u, v) = |F (u, v)|e
M
� −1 N
� −1
F (0, 0) = f (x, y) = M N f¯(x, y)
x=0 y=0
x=0 y=0
Chapter 4
rse discrete transform: Filtering in the Frequency Domain
rse discrete transform:
M
� −1 N�−1
1 M −j2π(ux/M +vy/N )
Translation and=Rotation
f (x, y) 1 � properties:
−1 N
� −1 F (u, v)e−j2π(ux/M +vy/N )
f (x, y) = M N u=0 v=0 F (u, v)e
M N u=0 v=0
−j2π(x0 u/M +y0 v/N )
f (x − x0 , y − y0 ) ⇔ F (u, v)e−j2π(x 0 u/M +y0 v/N )
f (x − x0 , y − y0 ) ⇔ F (u, v)e j2π(xu /M +yv /N )
F (u − u0 , v − v0 ) ⇔ f (x, y)ej2π(xu00/M +yv00/N )
F (u − u0 , v − v0 ) ⇔ f (x, y)e
1
1
Moreover, rotating f corresponds to rotating F of the same angle (and
vice-versa)
Chapter 4
Filtering in the Frequency Domain
figure, plot(real(fft(puls)))
high frequencies
Low frequencies
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 4
Filtering in the Frequency Domain
fftshift
Chapter 4
Filtering in the Frequency Domain
fftshift
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
F (u + k1 M, v + k2 N ) = F (u, v)
Spectrum and phase angle:
f (x + k1 M, y + k2 N ) = f (x, y)
jφ(u,v)
F (u, v) = |F (u, v)|e
Spectrum
1 phase angle
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Filter function
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Lowpass filters:
Highpass filters:
Chapter 4
Filtering in the Frequency Domain
Lowpass filters: These are filters that allow only the low
frequencies and take out the high frequencies
Highpass filters: These are filters that allow only the high
frequencies and take out the low frequencies
Chapter 4
Filtering in the Frequency Domain
Lowpass filters: These are filters that allow only the low
frequencies and take out the high frequencies
Highpass filters: These are filters that allow only the high
frequencies and take out the low frequencies
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
NB. We take the real part to remove spurious imaginary parts that
come from our computations (rounding etc.)
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 4
Filtering in the Frequency Domain
Lowpass filters:
Chapter 4
Filtering in the Frequency Domain
F (u + k1 M, v + k2 N ) = F (u, v)
F (u + k1 M, v + k2 N ) = F (u, v)
f (x + k1 M, y + k2 N ) = f (x, y)
jφ(u,v) f (x + k1 M, y + k2 N ) = f (x, y)
F (u, v) = |F (u, v)|e
M −1 N −1 F (u, v) = |F (u, v)|ejφ(u,v)
� �
F (0, 0) = f (x, y) = M N f¯(x, y) M
� −1 N
� −1
x=0 y=0 F (0, 0) = f (x, y) = M N f¯(x, y
x=0 y=0
g(x, y) = F −1 [H(u, v)F (u, v)]
g(x, y) = F −1 [H(u, v)F (u, v)]
H(u, v) = 1, if D(u, v) ≤ D0
H(u, v) = 0 if D(u, v) > D0 H(u, v) = 1, if D(u
H(u, v) = 0 if D(u
�
D(u, v) = (u − P/2)2 + (v − Q/2)2