Image Transforms
Image Transforms
by
Dr. K. M. Bhurchandi
The DFT of One - Variable
• Obtaining the DFT from the Continuous Transform of a
Sampled Function
sampled, continuous,
band-limited function FT periodic function
extending from -∞ to ∞ extending from -
∞ to ∞
• Equation of transform of sampled data in terms of sampled
function is given by:
• And we know
The DFT of One - Variable
where, n = 0, 1, 2, …, N-1
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:
w
here,
u = 0,
1, 2,
where,
…., x = 0, 1, 2, …, M-1
M-1
• Both the forward & inverse discrete transforms are infinitely
periodic with period M.
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:
• &
and
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
Δ𝑢 Δ𝑣
1
𝑀1Δ𝑇 𝑁
= =
&
Δ𝑍
Problems on DFT
1 1
1) Let f(x, y) = 1
1 1
is image matrix. Then DFT(F) = ?
1 1
1 1 2
Sol:-
10 1 1 𝑓 0, 𝑦 = ,11
f(x, y) = x y1 0 1-
=> 𝑓
1 1 1 = ,11
1 1, 𝑦 1-
2 1 𝑁−1
1𝑦 = 𝑓 2, 𝑦 = ,11
1 0 1-
𝑓(𝑦)𝑒
Generally, F(v) =
−𝑗2𝜋𝑣𝑦/𝑁
𝑦 =𝑓(0,
Thus, F1(0, v) = 𝑁−1
0
𝑦)𝑒 −𝑗2𝜋𝑣𝑦/𝑁
𝑦 =𝑓(0,
F1(0, v) = 𝑁−1
F1(0, v) = 𝑓(0, 0)𝑒−𝑗2𝜋𝑣0/3 𝑓(0,
0 1)𝑒 −𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒 −𝑗2𝜋𝑣2/3
𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁
+
2)𝑒−𝑗2𝜋1∗2/3
=1x1 + 1 x (-0.5000 - 0.8660i) + 1 x (-
0.5000 + 0.8660i)
2)𝑒 −𝑗2𝜋2∗2/3
Similarly, F1(1, v) = [3 0 0]; F1(2, v) = [3
& = 1 x 1 Thus, F = 3 0 0+0 1 x (-0.5000 + 0.8660i) + 1 x (-
0.5000 - 0.8660i) 3 0 0
1
=0
3 0 0
Now, applying transformation column-wise. 0];
So, F1(0, v) = [3 0 0];
Generally, F(u) = 𝑀−1 𝑥=
0
𝑓(𝑥)𝑒 −𝑗2𝜋𝑢𝑥/𝑀
+ F1(1,(𝑥,
𝐹
𝑥=0
𝑀−1 1
F(u, 0) = F1 (0, 0)𝑒 −𝑗2𝜋𝑢0/3 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2,
0)𝑒 −𝑗2𝜋𝑢𝑥/𝑀
Thus, F(u, 0) =
0)𝑒−𝑗2𝜋𝑢2/3
0)𝑒−𝑗2𝜋1∗2/3
=0x1 + 0 x (-0.5000 - 0.8660i) + 0 x (-
0.5000 + 0.8660i)
0)𝑒−𝑗2𝜋2∗2/3
Thus, F = 0 0 0
=0x1 + 0 x (-0.5000 + 0.8660i) + 0 x (-
0 0 0
0.5000 - 0.8660i)
=0
9 0 0
So, F(u, 0) = [9 0 0]; Similarly, F(u, 1) = [0 0 0]; & F(u, 2) = [0 0 0];
Problems on DFT
1 2 3
2) Let f(x, y) = 4 5 6 is image matrix.
7 8 9
Then DFT(F) = ?
Sol:- y 0 1 2
0 1 2 𝑓 0, 𝑦 = , 1 2
f(x, y) = x 3 3-
=> 𝑓
1 4 5 = ,45
6 1, 𝑦 6-
2 7 𝑁−18𝑦 = 𝑓 2, 𝑦 = , 7 8
9 0 9-
𝑓(𝑦)𝑒
Generally, F(v) =
−𝑗2𝜋𝑣𝑦/𝑁
𝑦 =𝑓(0,
Thus, F1(0, v) = 𝑁−1
0
𝑦)𝑒 −𝑗2𝜋𝑣𝑦/𝑁
𝑦 =𝑓(0,
1(0, v) = 𝑁−1
F1(0, v) = 𝑓(0, 0)𝑒 + 𝑓(0,
0 1)𝑒−𝑗2𝜋𝑣1/3 + 𝑓(0, 2)𝑒−𝑗2𝜋𝑣2/3
𝑦)𝑒−𝑗2𝜋𝑣𝑦/𝑁
F−𝑗2𝜋𝑣0/3
2)𝑒−𝑗2𝜋1∗2/3
=1x1 + 2 x (-0.5000 - 0.8660i) + 3 x
(-0.5000 + 0.8660i)
2)𝑒−𝑗2𝜋2∗2/3
= 16x 1 −1.5000 + 0.8660i −1.5000
+ 2 x (-0.5000
− 0.8660i+ 0.8660i) + 3 x
15 −1.5000
(-0.5000 - 0.8660i)
24 −1.5000
−1.5000 − 0.8660i
Thus, F1 = = -1.5000 +
- 0.8660i
+ 0.8660i −1.5000 − 0.8660i
0.8660i
Now, applying transformation column-wise.
So, F1(0, v) = [6 -1.5000 + 0.8660i -1.5000 - 0.8660i];
Similarly, F1(1, v) = [15 -1.5000 + 0.8660i -1.5000 -
0.8660i];
Generally, F(u) = 𝑀−1 𝑥=
0
𝑓(𝑥)𝑒 −𝑗2𝜋𝑢𝑥/𝑀
𝑥=0
𝑀−1 𝐹 1
(𝑥,
F(u, 0) = F1 (0, 0)𝑒−𝑗2𝜋𝑢0/3 + F1(1, 0)𝑒−𝑗2𝜋𝑢1/3 +F1(2,
0)𝑒 −𝑗2𝜋𝑢𝑥/𝑀
Thus, F(u, 0) =
0)𝑒−𝑗2𝜋𝑢2/3
1)𝑒−𝑗2𝜋1∗2/3
For, 1: F(0,
0 0
−13.5000 − 7.7940i
0.8660i)
= -13.5000 - 7.7940i
0 1
3) Let f(x, y) = 0
1 0
is image matrix. Then DFT(F) = ?
1 y −1 0 1
0 1
Sol:-
0 −1 0 1
f(x, y) = x 0
0 1 0
1
1 0𝑦 =−𝑁 1 𝑓(𝑦)𝑒 −𝑗2𝜋𝑣𝑦
Generally, F(v) = 𝑁/2
0 /2 /𝑁
𝑁/2
𝑦=−𝑁/ 𝑓(−1,
2
Thus, F1(-1, v) =
𝑦)𝑒 −𝑗2𝜋𝑣𝑦/𝑁
F1(-1, v) = 𝑓(−1, −𝑗2𝜋𝑣(−1)
+ 𝑓(−1, −𝑗 2𝜋 𝑣0
+ 𝑓 −1,
𝑗2𝜋𝑣
− 3
/3 /3
−1)𝑒 0)𝑒 1 𝑒
1
&
−0.5 + −2 1 + 1.73𝑖
−2 0.866𝑖
1
F = −2 𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒
1 4 (0, 0)
1
−2 1
−2
Symmetry Properties of 2D-DFT
Summary of DFT definitions
Summary of DFT definitions
Summary of DFT Pairs
Summary of DFT Pairs
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).
Image smoothing using Frequency 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
1,
lowpass filter (ILPF).
H 𝑢, 𝑣 = 𝑖𝑓 𝐷(𝑢, 𝑣) ≤ 𝐷
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
H 𝑢, 𝑣
1
=
𝐷
1 𝑢,𝑣 2𝑛
+
�0
�
Radial cross
section of filter
Filter as image from order 1 - 4
Image smoothing using Frequency 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.
Image smoothing using Frequency domain filters
• Gaussian Lowpass Filters:
• Gaussian lowpass filters(GLPF) in two dimensions is given by
= 𝑒 −𝐷
𝐻
(𝑢,𝑣)/2σ
2
𝑢, 𝑣
2
= 𝑒 −𝐷
2
HHP(u, v) = 1 – HLP(u, v)
0,
• A 2-D highpass filter is given by
H 𝑢, 𝑣 =
1, 𝑖𝑓 𝐷(𝑢, 𝑣) >
𝑖𝑓
𝐷0 𝐷(𝑢, 𝑣) ≤
𝐷0
Image sharpening using Frequency domain filter
IHPF
BHPF
GHPF
Image sharpening using Frequency domain filter
• Butterworth Highpass Filter
• A 2-D Butterworth highpass filter (BHPF) of order n and cutoff
H 𝑢, 𝑣
frequency D0 is defined as
1
=
1 𝐷 𝐷 2𝑛 0
+ 𝑢,𝑣
𝐻
2
= 1 − 𝑒 −𝐷
2
𝑢, 𝑣
(𝑢,𝑣)/2𝐷 0
Laplacian in the frequency domain
• The Laplacian can be implemented in the frequency domain
using the filter
H(u, v) = -4π2(u2 + v2)
v)+
𝑔 𝑥, 𝑦= 𝑓 𝑥, 𝑦+ 𝑐𝛻2𝑓(𝑥, 𝑦)
Enhancement is achieved using the equation
𝑔 𝑥, 𝑦= T − 1 *,1 + 4π2D2 u, v
• In frequency domain the above equation is written as:
-F(u, v)+
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)}
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.
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.
Summary of steps in homomorphic filtering
𝐻 𝑢, 𝑣 =
function 2
2-
, 1 − 𝑒 −𝑐,𝐷 (𝑢,𝑣)/𝐷0
γH − γcontrols
where, L
] + γL of the
the sharpness of the slope
function as it transitions between γL & γH