SYDE 575: Introduction to Image Processing

Download Report

Transcript SYDE 575: Introduction to Image Processing

SYDE 575: Image Processing
Spatial-Frequency Domain:
Discrete-Time Fourier Transform (DTFT) &
Discrete Fourier Transform (DFT)
Textbook: Chapter 4
Signal Representation
• As in continuous domain, exploit linearity and
shift invariance to find output as superposition
of responses to input components
• Use the sifting property:
f(m,n) = S
• Sketch:
S f( k, l ) d( m - k, n - l )
Apply Transformation
g(m,n) = T [ f(m,n) ]
=T[S
S f( k, l ) d( m - k, n - l ) ]
=S
S f( k, l ) T [ d( m - k, n - l ) ]
= S S f( k, l ) h( m - k, n - l )
= f(x,y) * h(x,y)
• Once again, if we want to obtain the original
signal f(x,y), deconvolution is a difficult
operation
Another Approach
• Just like the continuous domain, we can use a
discrete version of the frequency domain
• In this case, use complex exponential ej2pun
• A complex exponential remains untouched by an
LTI system. Why? Use ej2pun as the input:
ej2pun* h(n) = S h(k) ej2pu(n-k)
= [ S h(k) e-j2puk] ej2pun
= H(ej2pu) ej2pun
where H(ej2pu) is known as the discrete-time Fourier
transform (DTFT)
Notes on DTFT
Forward: H(ej2pu) = S h(k) e-j2puk
Inverse: h(n) =  H(u)ej2pundu (integrate 0 to 1)
1) ‘u’ represents continuous spatial-frequency
2) H(ej2pu) is periodic with period 1 since ej2pu is
periodic with period 1
3) If H(ej2pu) has no imaginary component, then
there is zero phase
Example: h(n) = [ 1/3 1/3 1/3 ]
Notes on DTFT (cont.)
4) If g(n) = f(n) * h(n), then
G(ej2pu) = F(ej2pu) H(ej2pu)
5) Since we only use finite extent signals
h(n) where 0 <= n <= N-1
Then DTFT is also a finite sum
H(ej2pu) = S h(n) e-j2puk
N samples!
(sum n=0 to N-1)
Extending DTFT to DFT
• We only have N samples, we only need N
samples for F(ej2pu)
• Instead of using range [0,1], stretch and
sample to range [0,N-1] to create discrete
Fourier transform (DFT)
Forward: F(u) = S f(n)e-j2pun/N
(sum n=0 to N-1)
Inverse: f(n) = (1/N)SF(u)ej2pun/N
(sum u=0 to N-1)
Both F(u) and f(n) are periodic
Implicit Periodicity
• Implicit periodicity to f(n) = DFT-1[F(u)]
• Example: 3pt average (periodic on N)
• So, while we define discrete arrays over a finite
interval, the DFT creates an implicit periodicity
outside the interval which complicates the use
of the DFT to implement LSI systems
• Example: f(n) = h(n) = 1 for n = 0,1,…,4
• What is the impact for digital image
processing?
DFT in 2D
• For an MxN image
– Forward DFT
F(u,v) = S
S f(x,y) e-j2p(ux/M+vy/N)
(sum x = 0 to M-1 and y = 0 to N-1)
– Inverse DFT
f(x,y) = S
S F(u,v) ej2p(ux/M+vy/N)
(sum u = 0 to M-1 and v = 0 to N-1)
How can we visualize the
spatial-frequency domain?
Fourier Spectra Characteristics
of Images



Most energy resides in low frequency components
 Implies that the original image can be
reconstructed with good approximation with the
low frequency components
Low frequency components correspond to coarse
details
 e.g., DC component represents average intensity
of an image
High frequency components correspond to fine
details
 e.g., edges, noise
Fourier Analysis: Spectra



In image coordinates, origin (0,0) refers to topleft corner
Results in spectra being centered at corner
Common to multiply input image by (-1)x+y.
Why?
Á éë f ( x, y )(-1) x+ y ùû = F (u - M / 2, v - N / 2)

Brings origin of spectra to center of image
Fourier Spectra Example
Source: Gonzalez and Woods
Fourier Spectra Example
Source: Gonzalez and Woods
Fourier Analysis: Phase

Characterizes structural information within an image
é I (u , v ) ù
f (u , v ) = tan ê
ú
ë R(u , v ) û
-1
Source: Gonzalez and Woods
Recall: Image Characteristics in
Frequency Domain



Low frequencies responsible for general
appearance of image over smooth areas
High frequencies responsible for detail
(e.g., edges and noise)
Intuitively, modifying different frequency
coefficients affects different characteristics
of an image
Example: DC component
removal

Suppose we remove the DC component
from the Fourier transform of an image
Source: Gonzalez and Woods
Why does it look like that?

DC component characterizes the mean of
the image intensities
1
F (0, 0) =
MN
1
=
MN
M -1 N -1
å å f (x , y )e
- j 2p (0x /M + 0y /N )
x= 0 y= 0
M -1 N -1
å å f (x , y ) = E [ f (x , y )]
x= 0 y= 0
Basic Steps of Filtering in
Spatial-Frequency Domain
1)Multiply input f(x,y) by (-1)x+y to center transform
2)Compute DFT of image, F(u,v)
3)Multiply F(u,v) by filter function H(u,v) to get
G(u,v)
4)Compute inverse DFT of G(u,v) to get g(x,y)
5)Multiply g(x,y) by (-1)x+y to get filtered image