Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

EE6310: Image and

Video Processing
Spring 2024
Discrete Fourier Transform
Discrete Fourier Transform
Discrete Fourier Transform
Discrete Fourier Transform
Discrete Fourier Transform
Sinusoidal Images

• Image with the simplest frequency content is the sinusoidal image


u v
• A discrete sine image: I(i, j) = sin[2π( N i + M j)]; 0 ≤ i ≤ (N − 1),0 ≤ j ≤ (M − 1)
• A discrete cosine uimage:v
I(i, j) = cos[2π( i + j)]; 0 ≤ i ≤ (N − 1),0 ≤ j ≤ (M − 1)
N M
• u, v are spatial integer frequencies along i, j respectively measured is cycles/image
−1
v 2 2
• Orientation = tan , radial frequency = u + v
u
Discrete Fourier Transform
Complex Exponential

• The complex exponential is used to de ne the Discrete Fourier


Transform

• The 2D complex uexponential


v
is de ned as:
exp[−2π −1( i + j)]
N M
• Note that we explicitly use −1 instead of i or j to avoid
confusion with image axes

• Convenient representation and manipulation of frequencies


fi
fi
Discrete Fourier Transform
Complex Exponential Notation and Properties


• Let WN = exp(− −1 N )
• From Euler’s identity:
2π 2π ui 2πui 2πui
WN = cos( ) − −1 sin( ), WN = cos( )− −1 sin( )
N N N N
1
• Minimum frequency when u = kN, maximum frequency when u = (k + 2 )N
• The complex exponential
u v
can therefore be written as
exp[−2π −1( i + j)] = WNuiWMvj
N M
• The powers of WN correspond to the spatial frequencies of the component sinusoids
vj
• Useful to think of WNuiWM as the representation of direction & frequency of
oscillation
Discrete Fourier Transform
History

• “Fourier’s theorem is not only


one of the most beautiful results
of modern analysis, but it may
be said to furnish an
indispensable instrument in the
treatment of nearly every
recondite question in modern
physics.” – Lord Kelvin
Discrete Fourier Transform
History

• “Yesterday was my 21st birthday,


at that age Newton and Pascal
had already acquired many
claims to immortality.” – Joseph
Fourier
Discrete Fourier Transform
De nition of Synthesis Equation

• Any image I of size M × N can be uniquely expressed as a


weighted sum of a nite number of complex exponential images:
N−1 M−1
1
Ĩ(u, v)WN−uiWM−vj
MN ∑ ∑
I(i, j) =
u=0 v=0

• The weights Ĩ(u, v) are unique


• Known as the Inverse Discrete Fourier Transform (IDFT) or the
synthesis equation
fi
fi
Discrete Fourier Transform
De nition of Analysis Equation

N−1 M−1
ui vj
∑∑
The forward transform: Ĩ(u, v) = I(i, j)WN WM

i=0 j=0

• Known as the Forward Discrete Fourier Transform (DFT) or the


analysis equation
fi
Discrete Fourier Transform
Notes

• I and Ĩ can be uniquely obtained from each other


• Remember:
• (i, j) are spatial indices
• (u, v) are spatial frequency indices
• The DFT Ĩ has the same dimension as the image:
Ĩ = [Ĩ(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]

• Linear: DFT[a1I1 + a2I2 + … + anIn] = a1Ĩ1 + a2Ĩ2 + … + anĨn


Discrete Fourier Transform
Notes

• Ĩ = Ĩreal + −1 Ĩimg where:


N−1 M−1
ui vj
∑∑
Ĩreal = [Ĩreal(u, v) = I(i, j)cos[2π( + )]; 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]
• i=0 j=0
N M
N−1 M−1
ui vj
∑∑
Ĩimag = [Ĩimag(u, v) = − I(i, j)sin[2π( + )]; 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]
• i=0 j=0
N M

• Magnitude image:
2 2
| Ĩ | = [ | Ĩ(u, v) | = Ireal (u, v) + Iimag (u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]

• Phase image:
Iimag(u, v)
∠Ĩ = [∠Ĩ(u, v) = arctan[ ]; 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]
Ireal(u, v)
Discrete Fourier Transform
Displaying the DFT

I ∠Ĩ

|I| log(1 + | Ĩ | )
Discrete Fourier Transform
Displaying the DFT

• Image DFT is usually displayed as images of magnitude and


phase

• Magnitude and phase represented by gray scale image


• Visually, phase does not convey much, however, very important
• Magnitude is usually log transformed followed by FSCS i.e.,
FSCS[log(1 + | Ĩ | )]
Discrete Fourier Transform
Properties

• Conjugate symmetry:
Ĩ(N − u, M − v) = Ĩ*(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)
(N−u)i −ui ui*
W
• N = WN = WN

• This implies the following:


• Ĩreal(N − u, M − v) = Ĩreal(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)

• Ĩimag(N − u, M − v) = − Ĩimag(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)

• | Ĩ(N − u, M − v) | = | Ĩ(u, v) | ; 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)


• ∠Ĩ(N − u, M − v) = − ∠Ĩ(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)
• Symmetry implies redundancy
Discrete Fourier Transform
Properties

• The DFT matrix is nite:


Ĩ = [Ĩ(u, v); 0 ≤ u ≤ (N − 1),0 ≤ v ≤ (M − 1)]

• What happens if we let u, v go outside this range?


(u+nN)i ui nNi ui
W
• N = WN NW = WN

• Ĩ(u + nN, v + mM) = Ĩ(u, v); ∀m, n ∈ ℤ


• This is called periodic extension of the DFT
fi
Discrete Fourier Transform
Properties

N−1 M−1
1 −ui −vj
MN ∑ ∑
Recall: I(i, j) = Ĩ(u, v)WN WM

u=0 v=0

• This implies I(i + nN, j + mM) = I(i, j)


−(u+nN)i
• WN = WN−uiWN−Ni = WN−ui

• When DFT is used, image periodicity is implied. Important in


convolution implementations
Discrete Fourier Transform
Properties
Discrete Fourier Transform
Properties

• Ideally, would like to have (u, v) = (0,0) at the center of the


image

• Low frequency components cluster around the center


• How can we achieve this?
• Modulation or frequency shifting
(i+j) −Ni/2 −Mj/2
• DFT[(−1) I(i, j)] = DFT[I(i, j)WN WM ] = Ĩ(u − N/2,v − M/2)

• This is only for display!


Discrete Fourier Transform
Properties
Discrete Fourier Transform
Interpreting Image Frequencies

• Image DFT or spectrum reveals much about image


• DFT magnitude can be regarded as image of frequency content
• Bright regions correspondto frequencies having large
magnitude

• Think of image frequency in terms of granularity and orientation


• Large DFT coe cients near the origin correspond to smooth
image

• The distribution of frequencies relative to the origin correspond to


granularity
ffi
Discrete Fourier Transform
Properties

• Matrix implementation of DFT


1 1 … 1
1 WN … WNN−1
WN =

• 2
1 WNN−1 … WN(N−1)
1 1 … 1
1 1 WN−1 … WN−(N−1)
W−1 = W* =
N
N N ⋮
• −(N−1)2
1 WN−(N−1) … WN
• Assuming N × N image
• Ĩ = WN IWN
• I=?

You might also like