Chapter 4 - Frequency Domain Processing
Chapter 4 - Frequency Domain Processing
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
1
The Lessons:
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
2
• Frequency- Number of times a periodic function repeats itself
per unit change in the independent variable.
• Periodic Function:- Function which have uniform structure
throughout.
• Fourier Series :- Any function that periodically repeats itself
can be expressed as a sum of sines and cosines of different
frequencies each multiplied by a constant factor. This sum is
known as Fourier series.
• Fourier Transform:- The function which are not periodic but
finite can be expressed as integral of sines and cosines
multiplied by weighting function. This is known as Fourier
transform.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
• Functions expressed in either Fourier series or Fourier
transform can be reconstructed completely via inverse
process with no loss of information.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
4
1-D Fourier Transform and its Inverse
+∞
F (u) = ∫ f (x) e -j 2Πux dx
-∞
Where j= √-1
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
5
1-D Inverse Fourier Transform
+∞
f (x) = ∫ F (u) e j2Πux du
-∞
Given F (u) we can obtain f (x) by inverse Fourier transform.
These two equations is Fourier transform pair.
It shows function (image) can be recovered from Fourier
transform.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
6
Discrete Fourier Transform
u= 0,1,2,…,M-1
Inverse
M-1
f (x) = Σ F (u) e j2Πux /M
u=0
x= 0,1,2,…,M-1
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
7
Frequency Domain
Each term of the Fourier transform is composed of sum of all values
of function f (x).
The values f (x) are multiplied by sines and cosines of various
frequencies. The domain over which the values of F (u) lies is
known as frequency domain.
u is frequency of all the components of transform. Each term M of F
(u) is called frequency component of transform. Fourier transform
can be compared with a glass prism. A prism separates light into
various color components each containing different wavelength and
frequency.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
8
• It is a mathematical prism which separates a function (image) into
various components each component having different frequency. This
concept will be used for filtering purpose.
• Since components of Fourier transform are complex quantities, so we
express F (u) in polar co-ordinates.
• Magnitude of Fourier transform:
• F (u) in polar co-ordinates
F (u)= I F (u) I e –jΦ(u)
where, I F (u) I = [ R2 (u) + I2 (u)]1/2
and Φ(u) = tan -1 (I (u) / R (u)) is phase angle or phase spectrum of
transform.
• P (u) = IF(u)I2 Spectral density or Power spectrum
• R (u) and I (u) are real and imaginary part of F (u) respectively.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
9
2-D DFT and its Inverse
u=0,1,…,M-1
v=0,1,…,N-1
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
10
Inverse
M-1 N-1
f (x,y) = Σ Σ F (u,v) e j2Π(ux /M + vy/N)
u=0 v=0
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
11
Fourier transform in 2D
• Phase angle in 2D
Φ(u,v) = tan -1 [ I (u,v) / R (u,v)]
Power Spectrum
P (u,v) = IF(u,v)I2
= R2 (u,v) + I2 (u,v)
R (u,v) –Real part of F (u,v)
I (u,v)- Imaginary part of F (u,v)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
12
Important
Before finding the Fourier transform, the function is multiplied by (-
1)x in case of 1D f (x) and (-1) x+y in case of 2D f (x,y).
This is done to shift the Fourier transform at center.
Frequency in image depends on the change in intensity.
If in some part gray levels are almost same then frequency is less
otherwise in abrupt changes frequency is more
Noise also have frequencies.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
13
• Fourier transform of a function f (x,y) multiplied by
(-1) x+y is given as F(u-M/2 , v-N/2)
F (0,0) = F(u-M/2 , v-N/2)
u – M/2 =0 v-N/2 =0
u = M/2 v= N/2
• If the size of the image is M x N the frequency at center will
be u,v
M-1 N-1
F (u,v) = 1/MN Σ Σ f (x,y) e –j2Π(ux / M + vy/N)
x=0 y=0
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
14
• When u=0 and v=0
M-1 N-1
F (0,0) = 1/MN Σ Σ f (x,y)
x=0 y=0
15
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
16
• Image is multiplied by (-1) x+y prior to computing Fourier
transform to center the spectrum.
• The separation of spectrum zeros in u direction is twice than v
direction because of rectangle.
• Spectrum is enhanced by log function to enhance gray level
detail.
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
17
Properties of Frequency Domain
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
18
Basic steps for filtering
Images taken from Gonzalez and Woods, 2016
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
The Basics of Filtering
1. Fourier Spectrum
Images taken from Gonzalez and Woods, 2016
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
The Basics of Filtering
2. Frequency Domain Filtering Fundamentals
DFT
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
DFT
Images taken from Gonzalez and Woods, 2016
DFT
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Fourier Transform Spectrum
FT Spectrum
Centered
FT Spectrum
FT Spectrum (centered + log)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Fourier Transform Spectrum
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Filter Function
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
The Importance of Zero Padding
Images taken from Gonzalez and Woods, 2016
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
The Importance of Zero Padding
(a) An image, (b) Result of blurring without padding (c) Result of blurring
with padding
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Smoothing
Smoothing can be done by reducing high frequency values. An image
filtering can be given as:
G(u,v) = H(u,v)F(u,v)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
ILF
where D0 >0 and D(u,v) denotes the distance between a point (u,v)
and the frequency center. D(u,v) can be defined as:
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
ILF
H(u,v)=1
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
ILF
Example:
Images taken from Gonzalez and Woods, 2016
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
ILF
(b)
(a)
(a) Representation of an ideal lowpass, radius 5 (b) Intensity profile
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
BLF
(a)Perspective plot of a BLF (b) Filter (c) Filter radial of order 1 through 4
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
BLF
Images taken from Gonzalez and Woods, 2016
Example:
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
BLF
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
GLF
Gaussian D0=5
Original image
Gaussian D0=85
Less ringing than BLPF Gaussian D0=230
but also less smoothing
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Lowpass Filters Comparison
Gaussian D0=15
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Lowpass Filtering Examples
Gaussian lowpass filter can be used to connect broken text from
scanning image.
Image
GLPF with
Do=100 GLPF with
Do=80
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Sharpening (Highpass filter)
High frequency coefficients contribute significantly in edges and fine
detail of images. Highpass filter is a reverse of lowpass filter:
HPF(u, v) = 1 – LPF(u, v)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Ideal Highpass Filters
Image Sharpening
(Highpass filter)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Butterworth Highpass Filters
Image Sharpening
(Highpass filter)
OER Digital Image Processing by Ferda Ernawan (editor) work is under licensed Creative Commons Attribution-
NonCommercial-NoDerivatives 4.0 International License.
Gaussian High-pass Filters
Image Sharpening
(Highpass filter)
Image Sharpening
(Highpass filter)
Image Sharpening
(Highpass filter)