Professional Documents
Culture Documents
Lecture 4 ©2005 P-O Östberg, Umeå University Page 1 Lecture 4 ©2005 P-O Östberg, Umeå University Page 2
Band-reject filter
A filter that rejects frequencies within a specified band and passes others
Lecture 4 ©2005 P-O Östberg, Umeå University Page 3 Lecture 4 ©2005 P-O Östberg, Umeå University Page 4
2 2
⎛ M⎞ ⎛ N⎞
D (u , v) = ⎜ u − ⎟ + ⎜ v − ⎟
⎝ 2 ⎠ ⎝ 2⎠
Lecture 4 ©2005 P-O Östberg, Umeå University Page 5 Lecture 4 ©2005 P-O Östberg, Umeå University Page 6
1
Notch filters Notch filters
0 If u = 0, v = 0
H (u , v) = otherwise
1
Notch filters are useful for diagnosing image content as they eliminate the
average gray level frequencies of the image
Can also be used to suppress a localized frequency contribution
(ex. 0 if u = s ± p, v = t ± q)
Lecture 4 ©2005 P-O Östberg, Umeå University Page 7 Lecture 4 ©2005 P-O Östberg, Umeå University Page 8
0 D(u,v) > D0
H (u , v) =
1 D(u,v) <= D0
Lecture 4 ©2005 P-O Östberg, Umeå University Page 9 Lecture 4 ©2005 P-O Östberg, Umeå University Page 10
Lecture 4 ©2005 P-O Östberg, Umeå University Page 11 Lecture 4 ©2005 P-O Östberg, Umeå University Page 12
2
Butterworth lowpass filters Butterworth lowpass filters
1
H (u , v) = 2n
⎡ D(u , v) ⎤
1+ ⎢ ⎥
⎣ D0 ⎦
Lecture 4 ©2005 P-O Östberg, Umeå University Page 13 Lecture 4 ©2005 P-O Östberg, Umeå University Page 14
Lecture 4 ©2005 P-O Östberg, Umeå University Page 15 Lecture 4 ©2005 P-O Östberg, Umeå University Page 16
D 2 ( u ,v )
−
2 D0 2
H (u, v) = e
3
Gaussian lowpass filters Ideal highpass filters
0 D(u,v) <= D0
H (u , v) =
1 D(u,v) > D0
Lecture 4 ©2005 P-O Östberg, Umeå University Page 19 Lecture 4 ©2005 P-O Östberg, Umeå University Page 20
Lecture 4 ©2005 P-O Östberg, Umeå University Page 21 Lecture 4 ©2005 P-O Östberg, Umeå University Page 22
1
H (u , v ) = 2n
⎡ D0 ⎤
1+ ⎢ ⎥
⎣ D(u , v) ⎦
Lecture 4 ©2005 P-O Östberg, Umeå University Page 23 Lecture 4 ©2005 P-O Östberg, Umeå University Page 24
4
Butterworth highpass filters Gaussian highpass filters
D 2 ( u ,v )
−
2 D0 2
H (u , v) = 1 − e
Lecture 4 ©2005 P-O Östberg, Umeå University Page 27 Lecture 4 ©2005 P-O Östberg, Umeå University Page 28
Lecture 4 ©2005 P-O Östberg, Umeå University Page 29 Lecture 4 ©2005 P-O Östberg, Umeå University Page 30
5
Laplacian in the frequency domain Laplacian in the frequency domain
[ ]
ℑ ∇ 2 f ( x, y ) = −(u 2 + v 2 ) F (u, v)
⎧⎪⎡ ⎛ ⎛ 2
M⎞ ⎛ N ⎞ ⎞⎤
2 ⎫⎪
⎡⎛ M⎞ ⎛ N⎞ ⎤
2 2 g ( x, y ) = ℑ −1 ⎨⎢1 − ⎜ ⎜ u − ⎟ + ⎜ v − ⎟ ⎟⎥ F (u, v)⎬
⎜ 2 ⎠ ⎟⎠⎥⎦
H (u, v) = − ⎢⎜ u − ⎟ + ⎜ v − ⎟ ⎥ ⎪⎩⎣⎢ ⎝ ⎝ 2 ⎠ ⎝ ⎪⎭
⎢⎣⎝ 2 ⎠ ⎝ 2 ⎠ ⎥⎦
When derived from the spatial domain H(u,v) need to be shifted (as above) As in the spatial domain, image enhancement using Laplace filtering can be
performed by one (frequency domain) operation
Care must be taken to scale the filter H(u,v) to [0,1]
Lecture 4 ©2005 P-O Östberg, Umeå University Page 31 Lecture 4 ©2005 P-O Östberg, Umeå University Page 32
f hp ( x, y ) = f ( x, y ) − f lp ( x, y ) f hb ( x, y ) = Af ( x, y ) − f lp ( x, y ) = ( A − 1) f ( x, y ) − f hp ( x, y )
Unsharp masking can be implemented by a single frequency domain operation High-boost filtering can be expressed as a single filter kernel when using
using the composite filter Laplace for fs
H hp (u , v ) = 1 − H lp (u , v ) H hb (u , v ) = ( A − 1) + H hp (u , v )
with A>= 1
Lecture 4 ©2005 P-O Östberg, Umeå University Page 33 Lecture 4 ©2005 P-O Östberg, Umeå University Page 34
H hfe (u , v ) = a + bH hp (u , v )
Lecture 4 ©2005 P-O Östberg, Umeå University Page 35 Lecture 4 ©2005 P-O Östberg, Umeå University Page 36
6
Homomorphic filtering Implementation: Periodicity
F (u , v) = F (u + M , v) = F (u , v + N ) = F (u + M , v + N )
f ( x, y ) = f ( x + M , y ) = f ( x, y + N ) = f ( x + M , y + N )
Both the forward and the inverse Fourier transforms are periodic
This periodicity is inherent from the definition of the discrete Fourier transform
pairs
Failure to account for the periodicity will result in wraparound error
Solution: pad both image & filter (with zeros) before computing the transform
Lecture 4 ©2005 P-O Östberg, Umeå University Page 37 Lecture 4 ©2005 P-O Östberg, Umeå University Page 38
f ( x, y ) 0 ≤ x ≤ A −1 and 0 ≤ y ≤ B −1
f e ( x, y ) =
0 A≤ x≤ P or B≤ y≤Q
h ( x, y ) 0 ≤ x ≤ C −1 and 0 ≤ y ≤ D −1
he ( x, y ) =
0 C≤x≤P or D≤ y≤Q
P ≥ A + C −1
Q ≥ B + D −1
Lecture 4 ©2005 P-O Östberg, Umeå University Page 39 Lecture 4 ©2005 P-O Östberg, Umeå University Page 40
Lecture 4 ©2005 P-O Östberg, Umeå University Page 41 Lecture 4 ©2005 P-O Östberg, Umeå University Page 42
7
The Fast Fourier Transform
The Fast Fourier Transform (FFT) is an algorithm that computes the Fourier
transform in a very efficient manner
The FFT uses successive doubling – computed values from previous iterations
are reused for the following iterations