Digital Image Processing Filtering in The Frequency Domain
Digital Image Processing Filtering in The Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the
Frequency Domain
4.1 Background
Chapter 4
Filtering in the Frequency Domain
2. Preliminary Concepts
1. Fourier Series
If f(t) is a periodic function of a continuous variable t, with period T
Where:
Chapter 4
Filtering in the Frequency Domain
and
Shifting property
:
Chapter 4
Filtering in the Frequency Domain
Sifting property :
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency
Domain
Example :
Chapter 4
Filtering in the Frequency
Domain
Chapter 4
Filtering in the Frequency Domain
Where :
=>
Chapter 4
Filtering in the Frequency Domain
4.2.5 Convolution
Convolution of functions f(t) and h(t), of one continuous variable t :
Chapter 4
Filtering in the Frequency Domain
4.3.1 Sampling
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the
Frequency Domain
Sampling Theorem:
A continuous, band-limited function can be recovered completely
from a set of its samples if the samples are acquired at a rate
exceeding twice the highest frequency content of the function
Chapter 4
Filtering in the Frequency
Domain
Chapter 4
Filtering in the
Frequency Domain
4.3.4 Aliasing
Chapter 4
Filtering in the Frequency Domain
4.3.4 Aliasing
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
fn : discrete function
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Both forward and inverse discrete transforms are infinitely periodic, with period M
Where k is an integer
Chapter 4
Filtering in the Frequency Domain
If f(x) consists of M samples of a function f(t) taken T units apart, the duration of
the record comprising the set {f(x)} is:
T = M T
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Sifting property:
Chapter 4
Filtering in the Frequency Domain
D discrete impulse:
Sifting property:
Chapter 4
Filtering in the Frequency Domain
f(t,z) continuous function of two continuous variables t and z, the 2-D continuous
Fourier transform pair is given by:
and
Chapter 4
Filtering in the Frequency Domain
Sampling in 2-D can be modeled using the sampling function (2-D impulse train):
Chapter 4
Filtering in the Frequency Domain
and
Chapter 4
Filtering in the Frequency Domain
Effects of aliasing can be reduced by slightly defocusing the scene to be digitized (attenuation of
high frequencies), before the image is sampled : anti-aliasing
Effects of aliasing generally are worsened when the size of a digital image is reduced
Chapter 4
Filtering in the Frequency Domain
Moiré patterns
In optics: beat patterns produced between two gratings of approximately equal spacing
Chapter 4
Filtering in the Frequency Domain
2-D Discrete Fourier Transform (DFT) of a digital image f(x,y) of size MxN:
Chapter 4
Filtering in the Frequency Domain
If T and Z are the separations between samples, the separations between the
corresponding discrete, frequency domain variables are:
and
Chapter 4
Filtering in the Frequency Domain
Translation:
and
Chapter 4
Filtering in the Frequency Domain
4.6.3 Periodicity
The 2-D Fourier Transform and its inverse are infinitely periodic in both directions:
and
Chapter 4
Filtering in the
Frequency Domain
4.6.3 Periodicity
1-D Spectrum
If u0 = M/2
Chapter 4
Filtering in the Frequency Domain
4.6.3 Periodicity
2-D Spectrum
FT Spectrum
Centered
FT Spectrum
Chapter 4
Filtering in the Frequency
Domain
(Reminder)
Chapter 4
Filtering in the Frequency Domain
Example:
If f(x,y) is a real function,
its Fourier transform is
conjugate symmetric:
Chapter 4
Filtering in the Frequency Domain
Power spectrum:
Chapter 4
Filtering in the Frequency Domain
and
=>
Where denotes
the average value of f
MN usually large => |F(0,0)| typically is the largest component of the spectrum
FT Spectrum
FT Spectrum
(centered)
FT Spectrum
(centered + log)
Chapter 4
Filtering in the Frequency
Domain
Original Image FT Spectrum
Spectrum is insensitive to
translation
But rotates by the same
angle
as the rotated image
Chapter 4
Filtering in the Frequency
Domain
Phase angle
Reconstruction
using phase angle only
Chapter 4
Filtering in the Frequency Domain
and conversely:
Chapter 4
Filtering in the Frequency
Domain
Chapter 4
Filtering in the Frequency Domain
FT Spectrum
Chapter 4
Filtering in the Frequency Domain
Given a digital image f(x,y) of size MxN, the basic filtering equation is:
Periodicity Periodicity
without padding without padding
Chapter 4
Filtering in the Frequency Domain
1. Given an input image f(x,y) of size MxN, obtain padding parameters P and
Q. Typically, P=2M and Q=2N.
2. Form a padded image fp(x,y) of size PxQ by appending the necessary number
of zeros to f(x,y).
3. Multiply fp(x,y) by (-1)x+y to centre its transform.
4. Compute the DFT, F(u,v), of the image from step 3.
5. Generate a real, symmetric filter function, H(u,v), of size PxQ with centre at
coordinates (P/2,Q/2). Form the product G(u,v)=H(u,v)F(u,v) using array
multiplication.
6. Obtain the processed image:
7. Obtain the final processed result, g(x,y), by extracting the MxN region from
the top, left quadrant of gp(x,y)
Chapter 4
Filtering in the Frequency
Domain
4.7.3 Steps for Filtering in the Frequency Domain
2) Padding 3) (-1)x+y
1)
4) DFT
5) Filter H
6) Filtered
image (IDFT) 7) Final
Result
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing
T. Peynot
Chapter 4
Filtering in the Frequency Domain
Where:
And D(u,v) is the distance between a point (u,v) and the centre of the frequency rectangle:
Chapter 4
Filtering in the Frequency Domain
The point of transition between H(u,v) = 1 and H(u,v) = 0 is called the cutoff
frequency
Example:
r = 30
r = 60
r = 160 r = 460
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
GLPF
(Do=80)
Original
Image
GLPF
(Do=100)
Chapter 4
Filtering in the Frequency Domain
A highpass HHP filter can be obtained from a given lowpass HLP filter by:
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Do = 30 Do = 60 Do = 160
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Do = 30 Do = 60 Do = 160
Chapter 4
Filtering in the Frequency Domain
The transfer function of the Gaussian Highpass Filter (GHPF) with cutoff frequency
locus at a distance D0 from the centre of the frequency rectangle is defined as:
Chapter 4
Filtering in the Frequency Domain
Do = 30 Do = 60 Do = 160
Chapter 4
Filtering in the Frequency
Domain
0
1
Chapter 4
Filtering in the Frequency
Domain
Highpass filtering
Thresholding
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
with
Chapter 4
Filtering in the Frequency Domain
Lowpass filter:
Highpass filter:
High-frequency-
emphasis filter
Chapter 4
Filtering in the Frequency Domain
Gaussian highpass
filtering
High-frequency Histogram
emphasis filtering Equalisation
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Bandreject Bandpass
Chapter 4
Filtering in the Frequency Domain
Reject (or pass) frequencies in a predefined neighbourhood about the centre of the
frequency rectangle
Constructed as products of highpass filters whose centres have been translated to
the centres of the notches
centre at centre at
Chapter 4
Filtering in the Frequency Domain
A Notch Pass filter (NP) is obtained from a Notch Reject filter (NR) using:
Butterworth notch
reject filter Filtered image
multiplied by FT
FT Spectrum
Vertical
notch reject
filter
Filtered image
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing
T. Peynot
Chapter 4
Filtering in the Frequency Domain
11. Implementation
1. Separability of the 2-D DFT
Where:
The 2-D DFT of f(x,y) can be obtained by computing the 1-D transform of each row of
f(x,y) and then computig the 1-D transform along each column of the result
Chapter 4
Filtering in the Frequency Domain
4.11 Implementation
4.11.2 Computing the IDFT Using a DFT Algorithm
=> = DFT of
Chapter 4
Filtering in the Frequency Domain
where:
M assumed to be =>
=>
=>
Chapter 4
Filtering in the Frequency Domain
Chapter 4
Filtering in the Frequency Domain
Glossary
• FT = Fourier Transform
• DFT = Discrete Fourier Transform
• IDFT = Inverse Discrete Fourier Transform
• FFT = Fast Fourier Transform
• ILPF (IHPF) = Ideal Lowpass (Highpass) Filter
• BLPF (BHPF) = Butterworth Lowpass (Highpass) Filter
• GLPF (GHPF) = Gaussian Lowpass (Highpass) Filter
• BP = Bandpass
• BR = Bandreject
• NP = Notch Pass
• NR = Notch Reject