Chapter 4
Chapter 4
Chapter Four:
Functions that are not periodic (but whose area under the curve is finite)
can be expressed as the integral of sines and/or cosines multiplied by a
weighting function (Fourier transform).
In the context of image processing, most natural images are non-periodic.
Each pixel in the image typically represents a unique value, and there is no
inherent repetition of image data across the boundaries of the image.
3
Image enhancement: Frequency Domain
Any periodic function can be decomposed into a summation of sines
and cosines
4
Image enhancement: Frequency Domain
Fig: the function at the bottom is the sum of the four functions above it. Fourier’s idea in
1807 that periodic functions could be presented as a weighted sum of sines and cosines
was met with skepticism 5
Fourier Transform
‘Fourier Transform’ means transforms one function into
another domain , which is called the frequency domain
representation of the original function
In image Processing the original function is in the Spatial
Domain
The term Fourier transform can refer to either the Frequency
domain representation of a function or to the process/formula
that "transforms" one function into the other.
We will be dealing only with functions (images) of finite
duration so we will be interested only in Fourier transform.
6
Image enhancement: Frequency Domain
Fourier transform is a mathematical operation used to decompose a
function, such as an image, into its frequency components.
Let's define the Fourier transform F for a function f defined on 𝑅𝑛 :
8
Image enhancement: Frequency Domain
The two-dimensional Fourier transform and its inverse
◦ Fourier transform (continuous case)
9
Image enhancement: Frequency Domain
The one-dimensional Fourier transform and its inverse
◦ Fourier transform (discrete case)
M 1
1
F (u )
M
f ( x )e
x 0
j 2ux / M
for u 0,1,2,..., M 1
10
Image enhancement: Frequency Domain
Since e j cos j sin and the fact cos( ) cos
then discrete Fourier transform can be redefined
M 1
1
F (u)
M
f ( x)[cos 2ux / M j sin 2ux / M ]
x 0
for u 0,1,2,..., M 1
◦ Frequency (time) domain: the domain (values of u) over which the
values of F(u) range; because u determines the frequency of the
components of the transform.
◦ Frequency (time) component: each of the M terms of F(u).
11
Image enhancement: Frequency Domain
• The two-dimensional Fourier transform and its inverse
– Fourier transform (discrete case)
M 1 N 1
1
F (u, v)
MN
x 0 y 0
f ( x, y )e j 2 (ux / M vy / N )
u 0 v 0
This framework forms the basis for various frequency domain image
processing techniques, such as Fourier transforms and filtering
operations.
13
Sampling in Frequency Domain
Continuous functions have to be converted into a sequence of discrete
values before they can be processed in a computer.
This requires sampling and quantization
14
Filtering in the Frequency Domain
Usually it is challenging task to make direct associations between specific
components of an image and its transform.
Some general statements can be made about the relationship between the
frequency components of the Fourier transform and spatial features of an
image.
◦ As we move away from the origin of the transform, the low frequencies
correspond to the slowly varying intensity components of an image.
◦ As we move further away from the origin, the higher frequencies begin to
correspond to faster and faster intensity changes in the image
Types of filter in Frequency Domain Filters:
◦ Lowpass Frequency Domain Filters
16
Image enhancement: Frequency Domain
17
Image enhancement: Frequency Domain
18
Lowpass Frequency Domain Filters
It is used for image smoothing.
Smoothing is achieved in the frequency domain by high-frequency
attenuation or rejection.
Edges and other sharp intensity transitions (such as noise) in an image
contribute significantly to the high frequency content of its Fourier
transform.
The basic model for filtering in the frequency domain
G (u , v) H (u , v) F (u , v)
where F(u,v): the Fourier transform of the image to be
smoothed and H(u,v): a filter transfer function
19
Lowpass Frequency Domain Filters
Three types of lowpass filters:
◦ Ideal: very sharp
◦ Butterworth: shape of a Butterworth filter is controlled by a
parameter called the filter order
For large values of this parameter, the Butterworth filter
approaches the ideal filter.
For lower values, the Butterworth filter is more like a Gaussian
filter.
◦ Gaussian: very smooth
20
Lowpass Frequency Domain Filters
0 if D(u, v) D0
H (u, v)
1 if D(u, v) D0
21
Lowpass Frequency Domain Filters
22
Lowpass Frequency Domain Filters
Gaussian lowpass filter (GLPF) transfer functions have the form
D 2 ( u ,v ) / 2 D02
H (u, v) e
where D0 is a parameter controlling the spread of the Gaussian function.
Fig: (a) Original image of size pixels. (b)–(f) Results of filtering using
GLPFs with cutoff frequencies at the radii (D0) 10, 30, 60, 160, and 460
24
Image enhancement: Frequency Domain
• One very useful property of the Gaussian function is that both it and
its Fourier transform are real valued and positive.
• These properties make the Gaussian filter very useful for lowpass
filtering an image.
25
Lowpass Frequency Domain Filters
Butterworth: shape of a Butterworth filter is controlled by a
parameter called the filter order.
The Butterworth Lowpass Filter provides a smooth transition
between passband and stopband, attenuating or rejecting high-
frequency components gradually.
The frequency response of the Butterworth Lowpass Filter is given
by:
a b c
Fig: Spatial representations of typical (a) ideal, (b) Butterworth, and (c) Gaussian
frequency domain highpass filters, and corresponding gray-level profiles 27
Image Sharpening Using Highpass Filters
Because edges and other rapid changes in intensities are associated
with high-frequency components, image sharpening can be achieved in
the frequency domain by highpass filtering,
28
Ideal, Gaussian, and Butterworth Highpass Filters
Fig: (a)–(c): Ideal, Gaussian, and Butterworth highpass spatial filters obtained from IHPF,
GHPF, and BHPF frequency-domain transfer functions. (The thin image borders are not
part of the data.) (d)–(f): Horizontal intensity profiles through the centers of the
kernels.
29
Image enhancement: Frequency Domain
0 if D(u, v) D0
H (u, v)
Ideal Highpass filter 1 if D(u, v) D0
a b c
Fig: Result of ideal highpass filtering the image in previous ILPF figure (a) with D0
= 15, 30, and 80 respectively.
30
Image enhancement: Frequency Domain
1
H (u, v)
Butterworth highpass filter 1 D0 / D(u, v)
2n
a b c
Fig: Result of highpass filtering the image in previous ILPF figure (a) using BHPF of
order 2 with D0=15,30, and 80 respectively. These results are much smoother
than those obtained with an ILPF 31
Image enhancement: Frequency Domain
a b c
Fig: Result of highpass filtering the image in previous ILPF figure (a) using GHPF of
order 2 with D0=15,30, and 80 respectively. than those obtained with an ILPF
32
Question
33
Question
34
Caution?
The enhanced image is expected to have better brightness and
contrast, good color consistency, reduced noise or defect, less visual
artifacts, or better resolution.
Mathematically an inverse problem and it is impossible to solve in
general-- something better under certain conditions.
If used inappropriately, enhancement techniques themselves:
◦ May increase noise while improving contrast,
◦ May eliminate small details and edge sharpness while removing noise,
◦ Produce artifacts in general.
35
36