SlideShare a Scribd company logo
1 of 72
DIGITALIMAGEPROCESSING
Filtering in the
Frequency Domain
by
Dr. K. M. Bhurchandi
The DFT of One - Variable
• Obtaining the DFT from the Continuous Transform of a Sampled
Function
sampled,
band-limited function FT
extending from -∞ to ∞
continuous,
periodic function
extending from -∞ to ∞
• Equation of transform of sampled data in terms of sampled function is
given by:
• And we know 2
The DFT of One - Variable
• Although fn is a discrete function, its Fourier is continuous and
infinitely periodic with period 1/ ΔT.
• Sampling one period is the basis for the DFT.
3
The DFT of One - Variable
• To have M equally spaced samples of the transform taken over the
period μ = 0 to 1/ ΔT, consider following frequencies,
where, m = 0, 1, 2, ….., M-1
Substituting it in previous equation, we get DFT equation:
Conversely, IDFT can be obtained by:
where, n = 0, 1, 2, …, N-1
4
The DFT of One - Variable
• In a more intuitive approach, notations used will be
x & y - image coordinates variables
u & v – frequency variables
Thus, the above equations become:
where, u = 0, 1, 2, …., M-1
where, x = 0, 1, 2, …, M-1
• Both the forward & inverse discrete transforms are infinitely
periodic with period M.
5
Extension to Functions of Two
Variables
• &
• The 2-D Impulse and Its Sifting Property:
• The impulse of 2 continuous variables t & z is given by:
• As in the 1D case, the 2D impulse exhibits the sifting property
under integration,
• More generally for an impulse located at coordinates (to, zo)
6
Extension to Functions of Two
Variables
• For discrete variables x & y, the 2D discrete impulse is defined
as:
• Its sifting property is:
• For an impulse located at coordinates (xo, yo)
7
Extension to Functions of Two
Variables
• Two-dimensional unit discrete impulse.
8
The 2-D Continuous Fourier
Transform Pair
• f(t, z) – continuous function of two variables, t & z.
• μ & γ – frequency variables define continuous frequency
domain.
9
• A 2-D function & its spectrum
10
2-D Samplingand the 2-D
Sampling Theorem
• 2-D impulse train is given by:
where, ΔT & ΔZ are separations between samples along t
& z axis.
11
2-D Sampling and the 2-D
Sampling Theorem
• Function f(t, z) is said to be band-limited if its Fourier
Transform is 0 outside a rectangle established by the intervals
[-μmax, μmax] and [-γmax, γmax].
• 2-Dimesional sampling theorem states that a continuous,
band limited function f(t, z) can be recovered with no error
from a set of its samples if the sampling intervals are
and
12
Aliasing in Images
• 2-D Fourier Transform of oversampled & under-sampled band
limited function
Aliasing in Images
• Two manifestations of aliasing in images:
• Spatial Aliasing & Temporal Aliasing
• Spatial Aliasing: It is due to under-sampling
• Temporal Aliasing: It is related to time intervals between
images in a sequence of images.
• E.g. wagon wheel effect (wheel appear to rotate backwards)
14
•Effects of Aliasing
15
The 2-D DFT and Its Inverse
• 2-D Discrete Fourier Transform Pairs:
where, f(x, y) – digital image of size M x N.
u – 0, 1, 2, ….., M-1
v – 0, 1, 2, ….., N-1
where, F(u, v) – transform of f(x, y).
x – 0, 1, 2, ….., M-1
y – 0, 1, 2, …., N-1
16
Properties of 2-D DFT
1) Relationships between Spatial & Frequency Intervals
• If a continuous function f(t, z) is sampled to form a digital
image, f(x, y) consisting of M x N samples in t & z resp.
• If ΔT & ΔZ denote the separations between samples, then,
separations between the corresponding discrete, frequency
domain variables are given by:
Δ𝑢 =
1
𝑀 Δ𝑇
& Δ𝑣 =
1
𝑁 Δ𝑍
17
Properties of 2-D DFT
2) Translation and Rotation
• Fourier transform pair satisfies translation properties
Multiplying f(x,y) by exponential shown shifts the origin of DFT
to (u0,v0) and conversely, multiplying F(u,v) by negative of that
exponential shifts the origin of f(x,y) to (x0,y0).
18
Properties of 2-D DFT
2) Translation and Rotation
Using Polar coordinates
Results in transform pair
Rotating f(x,y) with rotates F(u,v) by same angle and viceversa.
19
Properties of 2-D DFT
3) Periodicity
2D Fourier transform and its inverse are infinitely periodic in u
and v directions
and
where k1 and k2 are integers
20
Properties of 2-D DFT
3) Periodicity
21
Problems on DTFT
1 1 1
1) Let f(x, y) = 1 1 1 is image matrix. Then DFT(F) = ?
1 1 1
Sol:- y 0 1 2
0 1 1 1 𝑓 0, 𝑦 = [1 1 1]
f(x, y) = x 1 1 1 1 => 𝑓 1, 𝑦 = [1 1 1]
2 1 1 1 𝑓 2, 𝑦 = [1 1 1]
Generally, F(v) = ∑𝑁−1 𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁
𝑦 =0
1
Thus, F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/
𝑁
𝑦 =0 22
1
F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/
𝑁
𝑦=0
F1(0, v) = 𝑓(0, 0)𝑒−𝑗2𝜋𝑣0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋𝑣2/3
For, v = 0: F1(0, 0) = 𝑓(0, 0)𝑒−𝑗2𝜋0∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋0∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋0∗2/3
= 1 x 1 + 1 x 1 + 1 x 1 = 3
For, v = 1: F1(0, 1) = 𝑓(0, 0)𝑒−𝑗2𝜋1∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋1∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋1∗2/3
= 1 x 1 + 1 x (-0.5000 - 0.8660i) + 1 x (-0.5000 + 0.8660i)
= 0
For, v = 2: F1(0, 2) = 𝑓(0, 0)𝑒−𝑗2𝜋2∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋2∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋2∗2/3
= 1 x 1 + 1 x (-0.5000 + 0.8660i) + 1 x (-0.5000 - 0.8660i)
= 0
So, F1(0, v) = [3 0 0];
Similarly, F1(1, v) = [3 0 0]; & F1(2, v) = [3 0 0];
3 0 0
Thus, F1 = 3 0 0
3 0 0
Now, applying transformation column-wise.
23
Generally, F(u) = ∑𝑀−1 𝑓(𝑥)𝑒−𝑗2𝜋𝑢𝑥/𝑀
𝑥=0
Thus, F(u, 0) = ∑𝑀−1 𝐹 (𝑥, 0)𝑒−𝑗2𝜋𝑢𝑥/𝑀
𝑥=0 1
F(u, 0) = F1 (0, 0)𝑒−𝑗2𝜋𝑢0/3 + F1(1, 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2, 0)𝑒−𝑗2𝜋𝑢2/3
9 0 0
Thus, F = 0 0 0
0 0 0
For, u = 0: F(0, 0) = F1(0, 0)𝑒−𝑗2𝜋0∗0/3 +F1(1, 0)𝑒−𝑗2𝜋0∗1/3 +F1(2, 0)𝑒−𝑗2𝜋0∗2/3
= 3 x 1 + 3 x 1 + 3 x 1
= 9
For, u = 1: F(1, 0) = F1(0, 0)𝑒−𝑗2𝜋1∗0/3 +F1(1, 0)𝑒−𝑗2𝜋1∗1/3 +F1(2, 0)𝑒−𝑗2𝜋1∗2/3
= 0 x 1 + 0 x (-0.5000 - 0.8660i) + 0 x (-0.5000 + 0.8660i)
= 0
For, u = 2: F(2, 0) = F1(0, 0)𝑒−𝑗2𝜋2∗0/3 +F1(1, 0)𝑒−𝑗2𝜋2∗1/3 +F1(2, 0)𝑒−𝑗2𝜋2∗2/3
= 0 x 1 + 0 x (-0.5000 + 0.8660i) + 0 x (-0.5000 - 0.8660i)
= 0
So, F(u, 0) = [9 0 0]; Similarly, F(u, 1) = [0 0 0]; & F(u, 2) = [0 0 0];
24
Numerical on DFT
Then DFT(F) = ?
1 2 3
2) Let f(x, y) = 4 5 6 is image matrix.
7 8 9
Sol:- y 0 1 2
0 1 2 3 𝑓 0, 𝑦 = [1 2 3]
f(x, y) = x 1 4 5 6 => 𝑓 1, 𝑦 = [4 5 6]
2 7 8 9 𝑓 2, 𝑦 = [7 8 9]
Generally, F(v) = ∑𝑁−1 𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁
𝑦 =0
1
Thus, F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/
𝑁
𝑦 =0 25
1
F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦 /
𝑁
𝑦 =0
F1(0, v) = 𝑓(0, 0)𝑒−𝑗2𝜋𝑣0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋𝑣2/3
For, v = 0: F1(0, 0) = 𝑓(0, 0)𝑒−𝑗2𝜋0∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋0∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋0∗2/3
= 1 x 1 + 2 x 1 + 3 x 1 = 6
For, v = 1: F1(0, 1) = 𝑓(0, 0)𝑒−𝑗2𝜋1∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋1∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋1∗2/3
= 1 x 1 + 2 x (-0.5000 - 0.8660i) + 3 x (-0.5000 + 0.8660i)
= -1.5000 + 0.8660i
For, v = 2: F1(0, 2) = 𝑓(0, 0)𝑒−𝑗2𝜋2∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋2∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋2∗2/3
= 1 x 1 + 2 x (-0.5000 + 0.8660i) + 3 x (-0.5000 - 0.8660i)
= -1.5000 - 0.8660i
So, F1(0, v) = [6 -1.5000 + 0.8660i -1.5000 - 0.8660i];
Similarly, F1(1, v) = [15 -1.5000 + 0.8660i
& F1(2, v) = [24 -1.5000 + 0.8660i
-1.5000 - 0.8660i];
-1.5000 - 0.8660i];
Thus, F1 =
6 −1.5000 + 0.8660i
15 −1.5000 + 0.8660i
24 −1.5000 + 0.8660i
−1.5000 − 0.8660i
−1.5000 − 0.8660i
−1.5000 − 0.8660i
Now, applying transformation column-wise. 26
Generally, F(u) = ∑𝑀−1 𝑓(𝑥)𝑒−𝑗2𝜋𝑢𝑥/𝑀
𝑥=0
Thus, F(u, 0) = ∑𝑀−1 𝐹 (𝑥, 0)𝑒−𝑗2𝜋𝑢𝑥/𝑀
𝑥=0 1
F(u, 0) = F1 (0, 0)𝑒−𝑗2𝜋𝑢0/3 + F1(1, 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2, 0)𝑒−𝑗2𝜋𝑢2/3
For, u = 0: F(0, 0) = F1(0, 0)𝑒−𝑗2𝜋0∗0/3 +F1(1, 0)𝑒−𝑗2𝜋0∗1/3 +F1(2, 0)𝑒−𝑗2𝜋0∗2/3
= 6 x 1 + 15 x 1 + 24 x 1 = 45
For, u = 1: F(0, 1) = F1(0, 1)𝑒−𝑗2𝜋1∗0/3 +F1(1, 1)𝑒−𝑗2𝜋1∗1/3 +F1(2, 1)𝑒−𝑗2𝜋1∗2/3
= 6 x 1 + 15 x (-0.5000 - 0.8660i) + 24 x (-0.5000 + 0.8660i)
= -13.5000 + 7.7940i
For, u = 2: F(0, 2) = F1(0, 2)𝑒−𝑗2𝜋2∗0/3 +F1(1, 2)𝑒−𝑗2𝜋2∗1/3 +F1(2, 2)𝑒−𝑗2𝜋2∗2/3
= 6 x 1 + 15 x (-0.5000 + 0.8660i) + 24 x (-0.5000 - 0.8660i)
= -13.5000 - 7.7940i
Thus, F =
45
−13.5000 + 7.7940i
−13.5000 − 7.7940i
−4.5 + 2.59𝑖
0
0
−4.5 − 2.59𝑖
0
0
27
3) Let f(x, y) =
0 1 0
1 0 1
0 1 0
is image matrix. Then DFT(F) = ?
Sol:-
f(x, y) = x
y −1 0 1
−1 0 1 0
0 1 0 1
1 0 1 0
𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁
Generally, F(v) = ∑𝑁/2
𝑦 =−𝑁/2
1 𝑓(−1, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/
𝑁
Thus, F (-1, v) = ∑𝑁/2
𝑦=−𝑁
/2
28
F1(-1, v) = 𝑓(−1, −1)𝑒−𝑗2𝜋𝑣(−1)/3 + 𝑓(−1, 0)𝑒−𝑗 2𝜋𝑣
0/3
+ 𝑓 −1, 1 𝑒
−𝑗2𝜋𝑣1
3
&
F(u, -1) = F1 (−1, −1)𝑒−𝑗2𝜋𝑢(−1)/3 + F1(0, −1)𝑒−𝑗2𝜋𝑢0/3 +F1(1, −1)𝑒−𝑗2𝜋𝑢1/3
Then,
F =
4
−0.5 − 0.866𝑖
−0.5 + 0.866𝑖
−0.5 − 0.866𝑖
1 − 1.73𝑖
−2
−0.5 + 0.866𝑖
−2
1 + 1.73𝑖
𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑓. (−1, −1)
F =
−2 1 −2
1 4 1
−2 1 −2
𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 (0, 0)
29
Symmetry Properties of 2D-DFT
30
Summary of DFT definitions
31
Summary of DFT definitions
32
Summary of DFT Pairs
33
DFT of an image
34
Spectrumisinsensitivetotranslation.But
rotatesbythe sameangleas the rotated
image
35
Translation affects the phase
36
Reconstruction using either
spectrum or phase
37
Summary of DFT Pairs
38
Frequency Domain Filtering
Fundamentals
• Given a digital image f(x,y) of size MxN, the basic filtering
equation is
39
Result of Filtering an image
Input image Frequency
Spectrum
More Results on Filtering
40
Low Pass Filter
High Pass Filter
Top row: Frequency domain Filters, Bottom Row: Corresponding Filtered Images
Gaussian Low pass Filtering
41
Gaussian Low
Pass Filter
without padding
Gaussian Low
Pass Filter with
padding
Summary of steps for filtering in
Frequency domain
1) Given an input image f(x, y) of size M x N, obtain the padding parameters
P & Q as 2M & 2N respectively.
2) Form a padded image, fp(x, y), of size P x Q be appending the necessary
number of zeros to f(x, y).
3) Multiply fp(x, y) by (-1)x+y to center 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 P x Q with
center at coordinates (P/2, Q/2). Form the product G(u, v) = H(u, v)F(u, v)
using array multiplication; that is, G(i, k) = H(i, k)F(i, k).
6) Obtain the processed image: gp(x, y) = {real[Ṫ-1[G(u, v)]]}(-1)x+y where
the real part is selected in order to ignore parasitic complex components
resulting from computational inaccuracies, and the subscript p indicates
that we are dealing with padded arrays.
7) Obtain the final processed result, g(x, y), by extracting the M x N region
from the top, left quadrant of gp(x, y).
42
• Steps for Filtering in the Frequency Domain
43
ImagesmoothingusingFrequency
domain filters
• Ideal Lowpass Filters:
• A 2-D lowpass filter that passes without attenuation all
frequencies within a circle of radius D0 from the origin and
“cut off” all frequencies outside this circle is called an ideal
lowpass filter (ILPF).
H 𝑢, 𝑣
1, 𝑖𝑓 𝐷(𝑢, 𝑣) ≤ 𝐷0
=
0, 𝑖𝑓 𝐷(𝑢, 𝑣) > 𝐷0
Where, D0 - a positive constant
D(u, v) – distance between (u, v) in the frequency domain
and the center of the frequency rectangle; i.e.
D(u, v) = [(u – P/2)2 + (v – Q/2)2]1/2
Where P & Q are 2M & 2N resp. 44
Image smoothing using Frequency
domain filters Perspective plot
of an Ideal LPF
Filter as an image
Filter radial cross section
45
• Ideal Low Pass Filtering
46
R=30
47
R=10
R=160
R=60
R=460
Input Image
Results of Ideal LPF
The blurring and “ringing”
properties of Ideal LPFs
48
Representation in the spatial
domain od an ILPF of radius 5
and size 1000x1000.
Intensity profile of a horizontal
line passing through the
center of the image.
Image smoothing using Frequency
domain filters
• Butterworth Lowpass Filters:
• The transfer function of a Butterworth lowpass filter (BLPF) of
order n, and with cutoff frequency at a distance D0 from the
origin, is defined as,
H 𝑢, 𝑣 =
1
1+
𝐷 𝑢,𝑣
𝐷0
2𝑛
where, D(u, v) = [(u – P/2)2 + (v – Q/2)2]1/2
49
Image smoothing using Frequency
domain filters
from order 1 - 4
Perspective
plot of BLPF
Radial cross section of filter
Filter as an image
50
ImagesmoothingusingFrequency
domain filters
• Spatial representation of BLPF of order 1, 2, 5 & 20 &
corresponding intensity profiles through the center of the
filter.
• Ringing increases as a function of filter order.
51
Original Image
52
Results of filtering
using BLPF of order
2 with various cut
off frequencies
ImagesmoothingusingFrequency
domain filters
• Gaussian Lowpass Filters:
• Gaussian lowpass filters(GLPF) in two dimensions is given by
𝐻 𝑢, 𝑣
= 𝑒−𝐷 (𝑢,𝑣)/2σ
2 2
where, σ – is measure of spread about the center.
• Let σ = D0, thus the filter can be expressed as:
𝐻 𝑢, 𝑣
2 2
= 𝑒−𝐷 (𝑢,𝑣)/2𝐷0
where D0 is the cutoff frequency 53
ImagesmoothingusingFrequency
domain filters
Perspective
Plot of GLPF
Filter as an image Filter radial cross section
for diff D0
54
Gaussian Low pass Filters
Input Image
55
Results of
filtering using
GLPF with
various cut off
frequencies
Low Pass Filters
56
Applications of LPF
• Character Recognition
57
Sample text of low resolution
Note: broken characters
Result of filtering with GLPF
Note: broken character
segments are joined
Contd..
• Printing and publishing industry: “cosmetic” processing
58
Image sharpeningusing Frequency
domain filter
• A highpass filter is obtained from a given lowpass filter using
the equation
HHP(u, v) = 1 – HLP(u, v)
Where, HLP(u, v) – transfer function of the LPF
• Ideal Highpass Filter
• A 2-D highpass filter is given by
H 𝑢, 𝑣
0, 𝑖𝑓 𝐷(𝑢, 𝑣) ≤ 𝐷0
=
1, 𝑖𝑓 𝐷(𝑢, 𝑣) > 𝐷0
59
Image sharpeningusing Frequency
domain filter
IHPF
BHPF
GHPF
60
Spatial Representation of High
Pass Filter
61
Results of Ideal HPF
62
Image sharpeningusing Frequency
domain filter
• Butterworth Highpass Filter
• A 2-D Butterworth highpass filter (BHPF) of order n and cutoff
frequency D0 is defined as
H 𝑢, 𝑣 =
1
1+ 0
𝐷 𝑢,𝑣
𝐷 2𝑛
• Gaussian Highpass Filter
• The transfer function of the Gaussian highpass filter (GHPF)
with cutoff frequency locus of at a distance D0 from the center
of the frequency rectangle is given by
63
2 2
− 𝑒−𝐷 (𝑢,𝑣)/2𝐷0
𝐻 𝑢, 𝑣 = 1
Results of BHPF of order 2
• Results are much smoother than ideal HPF
64
Laplacian in the frequency domain
• The Laplacian can be implemented in the frequency domain
using the filter
H(u, v) = -4π2(u2 + v2)
Or with respect to the center of the frequency rectangle, using
the filter
H(u, v) = -4π2D2(u, v)
Where, D(u, v) is the distance function.
65
Laplacian in the frequency domain
The Laplacian image is obtained as:
❑2𝑓 𝑥, 𝑦= T − 1{H u, v F(u, v)}
Enhancement is achieved using the equation
𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 + 𝑐❑
2𝑓(𝑥, 𝑦)
• Here, c = -1, because, H(u, v) is negative
• In frequency domain the above equation is written as:
𝑔 𝑥, 𝑦 = T − 1{[1 + 4π2D2 u, v ]F(u, v)}
66
Homomorphic Filtering
• According to Illumination-Reflectance model:
• An image f(x, y) can be expressed as the product of its illumination,
i(x, y), and reflectance, r(x, y), components:
f(x, y) = i(x, y)r(x, y)
• Since the Fourier Transform of a product is not the product of he
transforms:
• So, F[f(x, y)] ≠ F[i(x, y)] F[r(x, y)]
• However, if,
z(x, y) = ln f(x, y)
= ln i(x, y) + ln r(x, y)
Then,
F{z(x, y)} = F{ln f(x, y)}
= F{ln i(x, y)} + F{ln r(x, y)}
67
Homomorphic Filtering
or
Z(u, v) = Fi(u, v) + Fr(u, v)
Where, Fi(u, v) and Fr(u, v) are the Fourier transforms of ln i(x, y) & ln
r(x, y) resp.
We can filter Z(u, v) using a filter H(u, v)
S(u, v) = H(u, v) Fi(u, v) + H(u, v) Fr(u, v)
The filtered image in spatial domain is
s(x, y) = T-1{S(u, v)}
= T-1{H(u, v) Fi(u, v)} + T-1{H(u, v) Fr(u, v)}
= i’(x, y) + r’(x, y)
where, i’(x, y) = T-1{H(u, v) Fi(u, v)}
r’(x, y) = T-1{H(u, v) Fr(u, v)}
68
Homomorphic Filtering
• In order to get the original image, we reverse the process,
g(x, y) = es(x, y)
= ei’(x, y)er’(x, y)
= i0(x, y)r0(x, y)
where, i0(x, y) = ei’(x, y) & r0(x, y) = er’(x, y) are the illumination and
reflectance components of the output (processed) image.
69
Summary of steps in homomorphic
filtering
• The illumination component of an image is characterized by
slow spatial variations, while the reflectance components tend
to vary abruptly.
• The low frequencies of DFT of Logarithm of an image are
associated with illumination and high frequencies with
reluctance.
70
Homomorphic Filtering
• Shows cross section of such a homomorphic filter H(u, v) that
affects low and high frequency components differently.
71
Homomorphic Filtering
• If parameters γL & γH are chosen such that γL < 1 & γH > 1, the
filter attenuates low frequencies and amplifies high
frequencies.
• It results in simultaneous dynamic range compression and
contrast enhancement. (Highpass filter)
• Slightly modified Gaussian highpass filter yields the function
𝐻 𝑢, 𝑣 =
2 2]
γH − γL [1 − 𝑒−𝑐[𝐷 (𝑢,𝑣)/𝐷0 ] + γL
where, controls the sharpness of the slope of the
function as it transitions between γL & γH
72

More Related Content

Similar to imagetransforms1-210417050321.pptx

Digital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domainDigital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domainMalik obeisat
 
07 frequency domain DIP
07 frequency domain DIP07 frequency domain DIP
07 frequency domain DIPbabak danyal
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Iidiarmseven
 
Digital Image Processing Module 3 Notess
Digital Image Processing Module 3 NotessDigital Image Processing Module 3 Notess
Digital Image Processing Module 3 Notessshivubhavv
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods thanhhoang2012
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidXavier Davias
 
Signals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainSignals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainKetan Solanki
 
Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transformSimranjit Singh
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
Frequency Domain Filtering 1.ppt
 Frequency Domain Filtering 1.ppt Frequency Domain Filtering 1.ppt
Frequency Domain Filtering 1.pptManishKumawat77
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing ssuser2797e4
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transformskalung0313
 
Newton’s Divided Difference Interpolation 18.pptx
Newton’s Divided Difference Interpolation 18.pptxNewton’s Divided Difference Interpolation 18.pptx
Newton’s Divided Difference Interpolation 18.pptxRishabhGupta238479
 
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier TransformDSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier TransformAmr E. Mohamed
 

Similar to imagetransforms1-210417050321.pptx (20)

Digital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domainDigital Image Processing_ ch3 enhancement freq-domain
Digital Image Processing_ ch3 enhancement freq-domain
 
07 frequency domain DIP
07 frequency domain DIP07 frequency domain DIP
07 frequency domain DIP
 
RES701 Research Methodology_FFT
RES701 Research Methodology_FFTRES701 Research Methodology_FFT
RES701 Research Methodology_FFT
 
lec07_DFT.pdf
lec07_DFT.pdflec07_DFT.pdf
lec07_DFT.pdf
 
Optics Fourier Transform Ii
Optics Fourier Transform IiOptics Fourier Transform Ii
Optics Fourier Transform Ii
 
Digital Image Processing Module 3 Notess
Digital Image Processing Module 3 NotessDigital Image Processing Module 3 Notess
Digital Image Processing Module 3 Notess
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
 
Signals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier DomainSignals and Systems Ch 4 5_Fourier Domain
Signals and Systems Ch 4 5_Fourier Domain
 
Dft
DftDft
Dft
 
Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transform
 
Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Wave diffraction
Wave diffractionWave diffraction
Wave diffraction
 
Senior Research
Senior ResearchSenior Research
Senior Research
 
Frequency Domain Filtering 1.ppt
 Frequency Domain Filtering 1.ppt Frequency Domain Filtering 1.ppt
Frequency Domain Filtering 1.ppt
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transforms
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Newton’s Divided Difference Interpolation 18.pptx
Newton’s Divided Difference Interpolation 18.pptxNewton’s Divided Difference Interpolation 18.pptx
Newton’s Divided Difference Interpolation 18.pptx
 
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier TransformDSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

imagetransforms1-210417050321.pptx

  • 1. DIGITALIMAGEPROCESSING Filtering in the Frequency Domain by Dr. K. M. Bhurchandi
  • 2. The DFT of One - Variable • Obtaining the DFT from the Continuous Transform of a Sampled Function sampled, band-limited function FT extending from -∞ to ∞ continuous, periodic function extending from -∞ to ∞ • Equation of transform of sampled data in terms of sampled function is given by: • And we know 2
  • 3. The DFT of One - Variable • Although fn is a discrete function, its Fourier is continuous and infinitely periodic with period 1/ ΔT. • Sampling one period is the basis for the DFT. 3
  • 4. The DFT of One - Variable • To have M equally spaced samples of the transform taken over the period μ = 0 to 1/ ΔT, consider following frequencies, where, m = 0, 1, 2, ….., M-1 Substituting it in previous equation, we get DFT equation: Conversely, IDFT can be obtained by: where, n = 0, 1, 2, …, N-1 4
  • 5. The DFT of One - Variable • In a more intuitive approach, notations used will be x & y - image coordinates variables u & v – frequency variables Thus, the above equations become: where, u = 0, 1, 2, …., M-1 where, x = 0, 1, 2, …, M-1 • Both the forward & inverse discrete transforms are infinitely periodic with period M. 5
  • 6. Extension to Functions of Two Variables • & • The 2-D Impulse and Its Sifting Property: • The impulse of 2 continuous variables t & z is given by: • As in the 1D case, the 2D impulse exhibits the sifting property under integration, • More generally for an impulse located at coordinates (to, zo) 6
  • 7. Extension to Functions of Two Variables • For discrete variables x & y, the 2D discrete impulse is defined as: • Its sifting property is: • For an impulse located at coordinates (xo, yo) 7
  • 8. Extension to Functions of Two Variables • Two-dimensional unit discrete impulse. 8
  • 9. The 2-D Continuous Fourier Transform Pair • f(t, z) – continuous function of two variables, t & z. • μ & γ – frequency variables define continuous frequency domain. 9
  • 10. • A 2-D function & its spectrum 10
  • 11. 2-D Samplingand the 2-D Sampling Theorem • 2-D impulse train is given by: where, ΔT & ΔZ are separations between samples along t & z axis. 11
  • 12. 2-D Sampling and the 2-D Sampling Theorem • Function f(t, z) is said to be band-limited if its Fourier Transform is 0 outside a rectangle established by the intervals [-μmax, μmax] and [-γmax, γmax]. • 2-Dimesional sampling theorem states that a continuous, band limited function f(t, z) can be recovered with no error from a set of its samples if the sampling intervals are and 12
  • 13. Aliasing in Images • 2-D Fourier Transform of oversampled & under-sampled band limited function
  • 14. Aliasing in Images • Two manifestations of aliasing in images: • Spatial Aliasing & Temporal Aliasing • Spatial Aliasing: It is due to under-sampling • Temporal Aliasing: It is related to time intervals between images in a sequence of images. • E.g. wagon wheel effect (wheel appear to rotate backwards) 14
  • 16. The 2-D DFT and Its Inverse • 2-D Discrete Fourier Transform Pairs: where, f(x, y) – digital image of size M x N. u – 0, 1, 2, ….., M-1 v – 0, 1, 2, ….., N-1 where, F(u, v) – transform of f(x, y). x – 0, 1, 2, ….., M-1 y – 0, 1, 2, …., N-1 16
  • 17. Properties of 2-D DFT 1) Relationships between Spatial & Frequency Intervals • If a continuous function f(t, z) is sampled to form a digital image, f(x, y) consisting of M x N samples in t & z resp. • If ΔT & ΔZ denote the separations between samples, then, separations between the corresponding discrete, frequency domain variables are given by: Δ𝑢 = 1 𝑀 Δ𝑇 & Δ𝑣 = 1 𝑁 Δ𝑍 17
  • 18. Properties of 2-D DFT 2) Translation and Rotation • Fourier transform pair satisfies translation properties Multiplying f(x,y) by exponential shown shifts the origin of DFT to (u0,v0) and conversely, multiplying F(u,v) by negative of that exponential shifts the origin of f(x,y) to (x0,y0). 18
  • 19. Properties of 2-D DFT 2) Translation and Rotation Using Polar coordinates Results in transform pair Rotating f(x,y) with rotates F(u,v) by same angle and viceversa. 19
  • 20. Properties of 2-D DFT 3) Periodicity 2D Fourier transform and its inverse are infinitely periodic in u and v directions and where k1 and k2 are integers 20
  • 21. Properties of 2-D DFT 3) Periodicity 21
  • 22. Problems on DTFT 1 1 1 1) Let f(x, y) = 1 1 1 is image matrix. Then DFT(F) = ? 1 1 1 Sol:- y 0 1 2 0 1 1 1 𝑓 0, 𝑦 = [1 1 1] f(x, y) = x 1 1 1 1 => 𝑓 1, 𝑦 = [1 1 1] 2 1 1 1 𝑓 2, 𝑦 = [1 1 1] Generally, F(v) = ∑𝑁−1 𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁 𝑦 =0 1 Thus, F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/ 𝑁 𝑦 =0 22
  • 23. 1 F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/ 𝑁 𝑦=0 F1(0, v) = 𝑓(0, 0)𝑒−𝑗2𝜋𝑣0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋𝑣2/3 For, v = 0: F1(0, 0) = 𝑓(0, 0)𝑒−𝑗2𝜋0∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋0∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋0∗2/3 = 1 x 1 + 1 x 1 + 1 x 1 = 3 For, v = 1: F1(0, 1) = 𝑓(0, 0)𝑒−𝑗2𝜋1∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋1∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋1∗2/3 = 1 x 1 + 1 x (-0.5000 - 0.8660i) + 1 x (-0.5000 + 0.8660i) = 0 For, v = 2: F1(0, 2) = 𝑓(0, 0)𝑒−𝑗2𝜋2∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋2∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋2∗2/3 = 1 x 1 + 1 x (-0.5000 + 0.8660i) + 1 x (-0.5000 - 0.8660i) = 0 So, F1(0, v) = [3 0 0]; Similarly, F1(1, v) = [3 0 0]; & F1(2, v) = [3 0 0]; 3 0 0 Thus, F1 = 3 0 0 3 0 0 Now, applying transformation column-wise. 23
  • 24. Generally, F(u) = ∑𝑀−1 𝑓(𝑥)𝑒−𝑗2𝜋𝑢𝑥/𝑀 𝑥=0 Thus, F(u, 0) = ∑𝑀−1 𝐹 (𝑥, 0)𝑒−𝑗2𝜋𝑢𝑥/𝑀 𝑥=0 1 F(u, 0) = F1 (0, 0)𝑒−𝑗2𝜋𝑢0/3 + F1(1, 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2, 0)𝑒−𝑗2𝜋𝑢2/3 9 0 0 Thus, F = 0 0 0 0 0 0 For, u = 0: F(0, 0) = F1(0, 0)𝑒−𝑗2𝜋0∗0/3 +F1(1, 0)𝑒−𝑗2𝜋0∗1/3 +F1(2, 0)𝑒−𝑗2𝜋0∗2/3 = 3 x 1 + 3 x 1 + 3 x 1 = 9 For, u = 1: F(1, 0) = F1(0, 0)𝑒−𝑗2𝜋1∗0/3 +F1(1, 0)𝑒−𝑗2𝜋1∗1/3 +F1(2, 0)𝑒−𝑗2𝜋1∗2/3 = 0 x 1 + 0 x (-0.5000 - 0.8660i) + 0 x (-0.5000 + 0.8660i) = 0 For, u = 2: F(2, 0) = F1(0, 0)𝑒−𝑗2𝜋2∗0/3 +F1(1, 0)𝑒−𝑗2𝜋2∗1/3 +F1(2, 0)𝑒−𝑗2𝜋2∗2/3 = 0 x 1 + 0 x (-0.5000 + 0.8660i) + 0 x (-0.5000 - 0.8660i) = 0 So, F(u, 0) = [9 0 0]; Similarly, F(u, 1) = [0 0 0]; & F(u, 2) = [0 0 0]; 24
  • 25. Numerical on DFT Then DFT(F) = ? 1 2 3 2) Let f(x, y) = 4 5 6 is image matrix. 7 8 9 Sol:- y 0 1 2 0 1 2 3 𝑓 0, 𝑦 = [1 2 3] f(x, y) = x 1 4 5 6 => 𝑓 1, 𝑦 = [4 5 6] 2 7 8 9 𝑓 2, 𝑦 = [7 8 9] Generally, F(v) = ∑𝑁−1 𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁 𝑦 =0 1 Thus, F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/ 𝑁 𝑦 =0 25
  • 26. 1 F (0, v) = ∑𝑁−1 𝑓(0, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦 / 𝑁 𝑦 =0 F1(0, v) = 𝑓(0, 0)𝑒−𝑗2𝜋𝑣0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋𝑣2/3 For, v = 0: F1(0, 0) = 𝑓(0, 0)𝑒−𝑗2𝜋0∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋0∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋0∗2/3 = 1 x 1 + 2 x 1 + 3 x 1 = 6 For, v = 1: F1(0, 1) = 𝑓(0, 0)𝑒−𝑗2𝜋1∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋1∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋1∗2/3 = 1 x 1 + 2 x (-0.5000 - 0.8660i) + 3 x (-0.5000 + 0.8660i) = -1.5000 + 0.8660i For, v = 2: F1(0, 2) = 𝑓(0, 0)𝑒−𝑗2𝜋2∗0/3 + 𝑓(0, 1)𝑒−𝑗2𝜋2∗1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋2∗2/3 = 1 x 1 + 2 x (-0.5000 + 0.8660i) + 3 x (-0.5000 - 0.8660i) = -1.5000 - 0.8660i So, F1(0, v) = [6 -1.5000 + 0.8660i -1.5000 - 0.8660i]; Similarly, F1(1, v) = [15 -1.5000 + 0.8660i & F1(2, v) = [24 -1.5000 + 0.8660i -1.5000 - 0.8660i]; -1.5000 - 0.8660i]; Thus, F1 = 6 −1.5000 + 0.8660i 15 −1.5000 + 0.8660i 24 −1.5000 + 0.8660i −1.5000 − 0.8660i −1.5000 − 0.8660i −1.5000 − 0.8660i Now, applying transformation column-wise. 26
  • 27. Generally, F(u) = ∑𝑀−1 𝑓(𝑥)𝑒−𝑗2𝜋𝑢𝑥/𝑀 𝑥=0 Thus, F(u, 0) = ∑𝑀−1 𝐹 (𝑥, 0)𝑒−𝑗2𝜋𝑢𝑥/𝑀 𝑥=0 1 F(u, 0) = F1 (0, 0)𝑒−𝑗2𝜋𝑢0/3 + F1(1, 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2, 0)𝑒−𝑗2𝜋𝑢2/3 For, u = 0: F(0, 0) = F1(0, 0)𝑒−𝑗2𝜋0∗0/3 +F1(1, 0)𝑒−𝑗2𝜋0∗1/3 +F1(2, 0)𝑒−𝑗2𝜋0∗2/3 = 6 x 1 + 15 x 1 + 24 x 1 = 45 For, u = 1: F(0, 1) = F1(0, 1)𝑒−𝑗2𝜋1∗0/3 +F1(1, 1)𝑒−𝑗2𝜋1∗1/3 +F1(2, 1)𝑒−𝑗2𝜋1∗2/3 = 6 x 1 + 15 x (-0.5000 - 0.8660i) + 24 x (-0.5000 + 0.8660i) = -13.5000 + 7.7940i For, u = 2: F(0, 2) = F1(0, 2)𝑒−𝑗2𝜋2∗0/3 +F1(1, 2)𝑒−𝑗2𝜋2∗1/3 +F1(2, 2)𝑒−𝑗2𝜋2∗2/3 = 6 x 1 + 15 x (-0.5000 + 0.8660i) + 24 x (-0.5000 - 0.8660i) = -13.5000 - 7.7940i Thus, F = 45 −13.5000 + 7.7940i −13.5000 − 7.7940i −4.5 + 2.59𝑖 0 0 −4.5 − 2.59𝑖 0 0 27
  • 28. 3) Let f(x, y) = 0 1 0 1 0 1 0 1 0 is image matrix. Then DFT(F) = ? Sol:- f(x, y) = x y −1 0 1 −1 0 1 0 0 1 0 1 1 0 1 0 𝑓(𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁 Generally, F(v) = ∑𝑁/2 𝑦 =−𝑁/2 1 𝑓(−1, 𝑦)𝑒−𝑗 2𝜋𝑣𝑦/ 𝑁 Thus, F (-1, v) = ∑𝑁/2 𝑦=−𝑁 /2 28
  • 29. F1(-1, v) = 𝑓(−1, −1)𝑒−𝑗2𝜋𝑣(−1)/3 + 𝑓(−1, 0)𝑒−𝑗 2𝜋𝑣 0/3 + 𝑓 −1, 1 𝑒 −𝑗2𝜋𝑣1 3 & F(u, -1) = F1 (−1, −1)𝑒−𝑗2𝜋𝑢(−1)/3 + F1(0, −1)𝑒−𝑗2𝜋𝑢0/3 +F1(1, −1)𝑒−𝑗2𝜋𝑢1/3 Then, F = 4 −0.5 − 0.866𝑖 −0.5 + 0.866𝑖 −0.5 − 0.866𝑖 1 − 1.73𝑖 −2 −0.5 + 0.866𝑖 −2 1 + 1.73𝑖 𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑓. (−1, −1) F = −2 1 −2 1 4 1 −2 1 −2 𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 (0, 0) 29
  • 31. Summary of DFT definitions 31
  • 32. Summary of DFT definitions 32
  • 33. Summary of DFT Pairs 33
  • 34. DFT of an image 34
  • 38. Summary of DFT Pairs 38
  • 39. Frequency Domain Filtering Fundamentals • Given a digital image f(x,y) of size MxN, the basic filtering equation is 39 Result of Filtering an image Input image Frequency Spectrum
  • 40. More Results on Filtering 40 Low Pass Filter High Pass Filter Top row: Frequency domain Filters, Bottom Row: Corresponding Filtered Images
  • 41. Gaussian Low pass Filtering 41 Gaussian Low Pass Filter without padding Gaussian Low Pass Filter with padding
  • 42. Summary of steps for filtering in Frequency domain 1) Given an input image f(x, y) of size M x N, obtain the padding parameters P & Q as 2M & 2N respectively. 2) Form a padded image, fp(x, y), of size P x Q be appending the necessary number of zeros to f(x, y). 3) Multiply fp(x, y) by (-1)x+y to center 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 P x Q with center at coordinates (P/2, Q/2). Form the product G(u, v) = H(u, v)F(u, v) using array multiplication; that is, G(i, k) = H(i, k)F(i, k). 6) Obtain the processed image: gp(x, y) = {real[Ṫ-1[G(u, v)]]}(-1)x+y where the real part is selected in order to ignore parasitic complex components resulting from computational inaccuracies, and the subscript p indicates that we are dealing with padded arrays. 7) Obtain the final processed result, g(x, y), by extracting the M x N region from the top, left quadrant of gp(x, y). 42
  • 43. • Steps for Filtering in the Frequency Domain 43
  • 44. ImagesmoothingusingFrequency domain filters • Ideal Lowpass Filters: • A 2-D lowpass filter that passes without attenuation all frequencies within a circle of radius D0 from the origin and “cut off” all frequencies outside this circle is called an ideal lowpass filter (ILPF). H 𝑢, 𝑣 1, 𝑖𝑓 𝐷(𝑢, 𝑣) ≤ 𝐷0 = 0, 𝑖𝑓 𝐷(𝑢, 𝑣) > 𝐷0 Where, D0 - a positive constant D(u, v) – distance between (u, v) in the frequency domain and the center of the frequency rectangle; i.e. D(u, v) = [(u – P/2)2 + (v – Q/2)2]1/2 Where P & Q are 2M & 2N resp. 44
  • 45. Image smoothing using Frequency domain filters Perspective plot of an Ideal LPF Filter as an image Filter radial cross section 45
  • 46. • Ideal Low Pass Filtering 46
  • 48. The blurring and “ringing” properties of Ideal LPFs 48 Representation in the spatial domain od an ILPF of radius 5 and size 1000x1000. Intensity profile of a horizontal line passing through the center of the image.
  • 49. Image smoothing using Frequency domain filters • Butterworth Lowpass Filters: • The transfer function of a Butterworth lowpass filter (BLPF) of order n, and with cutoff frequency at a distance D0 from the origin, is defined as, H 𝑢, 𝑣 = 1 1+ 𝐷 𝑢,𝑣 𝐷0 2𝑛 where, D(u, v) = [(u – P/2)2 + (v – Q/2)2]1/2 49
  • 50. Image smoothing using Frequency domain filters from order 1 - 4 Perspective plot of BLPF Radial cross section of filter Filter as an image 50
  • 51. ImagesmoothingusingFrequency domain filters • Spatial representation of BLPF of order 1, 2, 5 & 20 & corresponding intensity profiles through the center of the filter. • Ringing increases as a function of filter order. 51
  • 52. Original Image 52 Results of filtering using BLPF of order 2 with various cut off frequencies
  • 53. ImagesmoothingusingFrequency domain filters • Gaussian Lowpass Filters: • Gaussian lowpass filters(GLPF) in two dimensions is given by 𝐻 𝑢, 𝑣 = 𝑒−𝐷 (𝑢,𝑣)/2σ 2 2 where, σ – is measure of spread about the center. • Let σ = D0, thus the filter can be expressed as: 𝐻 𝑢, 𝑣 2 2 = 𝑒−𝐷 (𝑢,𝑣)/2𝐷0 where D0 is the cutoff frequency 53
  • 54. ImagesmoothingusingFrequency domain filters Perspective Plot of GLPF Filter as an image Filter radial cross section for diff D0 54
  • 55. Gaussian Low pass Filters Input Image 55 Results of filtering using GLPF with various cut off frequencies
  • 57. Applications of LPF • Character Recognition 57 Sample text of low resolution Note: broken characters Result of filtering with GLPF Note: broken character segments are joined
  • 58. Contd.. • Printing and publishing industry: “cosmetic” processing 58
  • 59. Image sharpeningusing Frequency domain filter • A highpass filter is obtained from a given lowpass filter using the equation HHP(u, v) = 1 – HLP(u, v) Where, HLP(u, v) – transfer function of the LPF • Ideal Highpass Filter • A 2-D highpass filter is given by H 𝑢, 𝑣 0, 𝑖𝑓 𝐷(𝑢, 𝑣) ≤ 𝐷0 = 1, 𝑖𝑓 𝐷(𝑢, 𝑣) > 𝐷0 59
  • 60. Image sharpeningusing Frequency domain filter IHPF BHPF GHPF 60
  • 61. Spatial Representation of High Pass Filter 61
  • 63. Image sharpeningusing Frequency domain filter • Butterworth Highpass Filter • A 2-D Butterworth highpass filter (BHPF) of order n and cutoff frequency D0 is defined as H 𝑢, 𝑣 = 1 1+ 0 𝐷 𝑢,𝑣 𝐷 2𝑛 • Gaussian Highpass Filter • The transfer function of the Gaussian highpass filter (GHPF) with cutoff frequency locus of at a distance D0 from the center of the frequency rectangle is given by 63 2 2 − 𝑒−𝐷 (𝑢,𝑣)/2𝐷0 𝐻 𝑢, 𝑣 = 1
  • 64. Results of BHPF of order 2 • Results are much smoother than ideal HPF 64
  • 65. Laplacian in the frequency domain • The Laplacian can be implemented in the frequency domain using the filter H(u, v) = -4π2(u2 + v2) Or with respect to the center of the frequency rectangle, using the filter H(u, v) = -4π2D2(u, v) Where, D(u, v) is the distance function. 65
  • 66. Laplacian in the frequency domain The Laplacian image is obtained as: ❑2𝑓 𝑥, 𝑦= T − 1{H u, v F(u, v)} Enhancement is achieved using the equation 𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 + 𝑐❑ 2𝑓(𝑥, 𝑦) • Here, c = -1, because, H(u, v) is negative • In frequency domain the above equation is written as: 𝑔 𝑥, 𝑦 = T − 1{[1 + 4π2D2 u, v ]F(u, v)} 66
  • 67. Homomorphic Filtering • According to Illumination-Reflectance model: • An image f(x, y) can be expressed as the product of its illumination, i(x, y), and reflectance, r(x, y), components: f(x, y) = i(x, y)r(x, y) • Since the Fourier Transform of a product is not the product of he transforms: • So, F[f(x, y)] ≠ F[i(x, y)] F[r(x, y)] • However, if, z(x, y) = ln f(x, y) = ln i(x, y) + ln r(x, y) Then, F{z(x, y)} = F{ln f(x, y)} = F{ln i(x, y)} + F{ln r(x, y)} 67
  • 68. Homomorphic Filtering or Z(u, v) = Fi(u, v) + Fr(u, v) Where, Fi(u, v) and Fr(u, v) are the Fourier transforms of ln i(x, y) & ln r(x, y) resp. We can filter Z(u, v) using a filter H(u, v) S(u, v) = H(u, v) Fi(u, v) + H(u, v) Fr(u, v) The filtered image in spatial domain is s(x, y) = T-1{S(u, v)} = T-1{H(u, v) Fi(u, v)} + T-1{H(u, v) Fr(u, v)} = i’(x, y) + r’(x, y) where, i’(x, y) = T-1{H(u, v) Fi(u, v)} r’(x, y) = T-1{H(u, v) Fr(u, v)} 68
  • 69. Homomorphic Filtering • In order to get the original image, we reverse the process, g(x, y) = es(x, y) = ei’(x, y)er’(x, y) = i0(x, y)r0(x, y) where, i0(x, y) = ei’(x, y) & r0(x, y) = er’(x, y) are the illumination and reflectance components of the output (processed) image. 69
  • 70. Summary of steps in homomorphic filtering • The illumination component of an image is characterized by slow spatial variations, while the reflectance components tend to vary abruptly. • The low frequencies of DFT of Logarithm of an image are associated with illumination and high frequencies with reluctance. 70
  • 71. Homomorphic Filtering • Shows cross section of such a homomorphic filter H(u, v) that affects low and high frequency components differently. 71
  • 72. Homomorphic Filtering • If parameters γL & γH are chosen such that γL < 1 & γH > 1, the filter attenuates low frequencies and amplifies high frequencies. • It results in simultaneous dynamic range compression and contrast enhancement. (Highpass filter) • Slightly modified Gaussian highpass filter yields the function 𝐻 𝑢, 𝑣 = 2 2] γH − γL [1 − 𝑒−𝑐[𝐷 (𝑢,𝑣)/𝐷0 ] + γL where, controls the sharpness of the slope of the function as it transitions between γL & γH 72