Filtering in the Frequency Domain
Filtering in the Frequency Domain
MULTIMEDIA
FILTERING IN THE FREQUENCY DOMAIN
This filter would reject the dc term and “pass” (i.e., leave unchanged) all other terms.
Note that the dc term is responsible for the average intensity of an image, so setting it to
zero will reduce the average intensity of the output image to zero. Figure 4.30 shows the
image became much darker.
The Basic Filtering in the Frequency Domain
The Basic Filtering in the Frequency Domain
Note:
At (b) the blurring is not
uniform; the top white
edge is blurred, but the
side white edges are not.
Zero-Phase-Shift Filters
−1
g ( x, y) = {H (u, v) F (u, v)}
F (u, v) = R(u, v) + jI (u, v)
g ( x, y) = −1
H (u, v)R(u, v) + jH (u, v)I (u, v)
Filters affect the real and imaginary parts equally,
and thus no effect on the phase.
These filters are called zero-phase-shift filters
Examples: Nonzero-Phase-Shift Filters
Even small
Phasechanges
angle is in the phase angle can ishave
Phase angle
dramaticmultiplied
(usually by undesirable) effects on the
multiplied by filtered
output 0.5 0.25
Summary:
Steps for Filtering in the Frequency Domain
1. Given an input image f(x,y) of size MxN, obtain the
padding parameters P and Q. Typically, P = 2M and Q = 2N.
g p ( x, y) = real −1 G(u, v) (−1) x + y
600x600
Correspondence Between Filtering in the Spatial
and Frequency Domains: Example
Generate H(u,v)
h( x, y ) 0 x 2 and 0 y 2
hp ( x, y ) =
0 3 x 602 or 3 y 602
By letting = D0
− D 2 ( u ,v )/2 D02
H (u, v) = e
Image Smoothing Using Filter Domain Filters: GLPF
Examples of smoothing by GLPF (1)
Examples of smoothing by GLPF (2)
An application of lowpass filtering for producing a smoother, softer-looking
result from a sharp original.
For human faces, the typical objective is to reduce the sharpness of fine
skin lines and small blemishes.
Examples of smoothing by GLPF (3)
Image Sharpening Using Frequency Domain
Filters
A highpass filter is obtained from a given lowpass filter
using
H HP (u, v) = 1 − H LP (u, v)
BHPF
(order 4 with a cutoff
frequency 50)
The Laplacian in the Frequency Domain
H (u, v) = −4 2 (u 2 + v 2 )
Enhancement is obtained
g ( x, y ) = f ( x, y ) + c 2 f ( x, y ) c = -1
The Laplacian in the Frequency Domain
= −1 1 + 4 2 D 2 (u , v) F (u, v)
The Laplacian in the Frequency Domain
Unsharp Masking, Highboost Filtering and High-
Frequency-Emphasis Fitering
gmask ( x, y) = f ( x, y) − f LP ( x, y)
g ( x, y ) = −1 1 + k * 1 − H LP (u, v) F (u, v)
= −1 1 + k * H HP (u, v) F (u, v)
Unsharp Masking, Highboost Filtering and High-
Frequency-Emphasis Fitering
−1
g ( x, y ) = k
1 + k2 * H HP (u, v) F (u, v)
k1 0 and k2 0
Gaussian Filter
D0=40
High-Frequency-Emphasis Filtering
Gaussian Filter
K1=0.5, k2=0.75
Homomorphic Filtering
Improving the appearance of an image by simultaneous intensity range
compression and contrast enhancement.
An image can be expressed as the product of its illumination and reflectance
f ( x, y) = i( x, y)r ( x, y)
f ( x, y) = i( x, y) r ( x, y) ?
z( x, y) = ln f ( x, y) = ln i( x, y) + ln r ( x, y)
Non-Selective Filters:
operate over the entire frequency rectangle
Selective Filters
operate over some part, not entire frequency rectangle
• bandreject or bandpass: process specific bands
• notch filters: process small regions of the frequency
rectangle
Selective Filtering:
Bandreject and Bandpass Filters
H BP (u, v) = 1 − H BR (u, v)
Selective Filtering:
Bandreject and Bandpass Filters
Selective Filtering:
Notch Filters
Zero-phase-shift filters must be symmetric about the origin.
A notch with center at (u0, v0) must have a corresponding
notch at location (-u0,-v0).
where H k (u, v) and H - k (u, v) are highpass filters whose centers are
at (uk , vk ) and (-uk , -vk ), respectively.
Selective Filtering:
Notch Filters
Q
H NR (u , v ) = H k (u , v ) H − k (u , v )
k =1
where H k (u, v) and H - k (u, v) are highpass filters whose centers are
at (uk , vk ) and (-uk , -vk ), respectively.
2 1/2
D− k (u, v) = (u − M / 2 + uk ) + (v − N / 2 + vk )
2
Examples:
Notch Filters
(1)
A Butterworth notch
reject filter D0 =3
and n=4 for all
notch pairs
Examples:
Notch Filters (2)