Professional Documents
Culture Documents
Christophoros Nikou
cnikou@cs.uoi.gr
• It may be
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
considered both as
continuous and
discrete.
• Useful for the
representation of , x x0
discrete signals ( x x0 )
0 otherwise
through sampling
of continuous
signals.
f ( x) ( x x0 )dx f ( x0 )
ST (t ) (t nT )
n
x[n] x(t ) S T (t ) x(t ) (t nT ) x(nT ) (t nT )
n n
x(t ) (t nT )
n
x(nT ) (t nT )
n
signal f (t).
2
ce
j nt
f (t ) n
T
n
T /2 2
1 j nt
cn
T T / 2
f (t )e T
dt
signal f (t).
F ( )
j 2 t
f (t )e dt
F ( )e d
j 2t
f (t )
• Attention: the variable is the frequency (Hz) and
not the radial frequency (Ω=2πμ) as in the Signals
and Systems course.
C. Nikou – Digital Image Processing (E12)
10 1D continuous signals (cont.)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
sin(W )
f (t ) PW / 2 (t ) F ( ) W
(W )
C. Nikou – Digital Image Processing (E12)
11 1D continuous signals (cont.)
f (t )* h(t )
f ( )h(t )d
f (t )* h(t ) F ( ) H ( )
f (t )h(t ) F ( ) * H ( )
• Intermediate result
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
x(t ) (t nT )
n
x(nT ) (t nT )
n
• Sampling
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
f (t ) F ( )
1 n
f (nT ) f [n] F ( )
T
n
F
T
Nyquist theorem
1
2 max
T
FT of a continuous signal
Oversampling
Undersampling
Aliasing appears
C. Nikou – Digital Image Processing (E12)
17 1D continuous signals (cont.)
F ( ) F ( ) H ( )
t
f (t ) f (t ) * T sin c
T
C. Nikou – Digital Image Processing (E12)
18 1D continuous signals (cont.)
• Reconstruction
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
(t nT )
f (t )
n
f (nT ) sinc
n T
Aliased signal
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
N 1 2 nk
j
F [k ] f [n]e N
, 0 k N 1
n 0
N 1 2 nk
1
F[k ]e
j
f [ n] N
, 0 n N 1
N n 0
1 N kn 1, k rN , r
wN
N n 0 0, otherwise
2
j
wN e N
1 N 1
f [n] F [k ]wN ,
nk
0 n N 1
N n 0
2
j
wN e N
A N N N
w N 1 0 w w
N 1 1 N 1 2
wN
N 1 N 1
N N N
1 1 1 1
1 j 1 j
A
1 1 1 1
1 j 1 j
g[n] f [n]* h[n]
m
f [m]h[n m]
is of length N=N1+N2-1=4
f [ m] 1 2 2 g[ n]
n0 h[0 m] 1 1 1
n 1 h [1 m] 1 1 1
n2 h[2 m] 1 1 0
n3 h [3 m] 1 1 2
g[n] {1, 1, 0, 2}
C. Nikou – Digital Image Processing (E12)
31 Circular shift
g[n]=f [n]h[n]
m
f [m]h[(n m) N ]
f [ m] 1 2 2 g[ n]
n 0 h [(0 m) N ] 1 1 1 1
n 1 h [(1 m) N ] 1 1 1
n 2 h [(2 m) N ] 1 1 0
g[n] { 1, 1, 0,}
C. Nikou – Digital Image Processing (E12)
34 DFT and convolution
Zero-padded signals
C. Nikou – Digital Image Processing (E12)
36 DFT and convolution (cont.)
f [n] {1, 2, 2}, h[n] {1, 1}, N1 3, N 2 2
f [ m] 1 2 2 0 g[ n]
h[(n 0)4 ] 0 0 1 1 0 0 1 1
h[(n 1) 4 ] 0 0 1 1 0 0 1
h[(n 2) 4 ] 0 0 1 1 0 0
h[(n 3)4 ] 0 0 1 1 2
The result is the same as the linear convolution.
C. Nikou – Digital Image Processing (E12)
37 DFT and convolution (cont.)
Verification using DFT
1 1 1 1 1 5
1 j 1 j 2 1 j 2
F = Af
1 1 1 1 2 1
1 j 1 j 0 1 j 2
1 1 1 1 1 0
1 j 1 j 1 1 j
H = Ah
1 1 1 1 0 2
1 j 1 j 0 1 j
C. Nikou – Digital Image Processing (E12)
38 DFT and convolution (cont.)
G[k ] F [k ] H [k ]
Element-wise multiplication
5 0 0
(1 j 2) (1 j ) 1 j 3
G = FH
1 2 2
(1 j 2) (1 j ) 1 j3
1 1 1 1 0 1
1 j 1 j 1 j 3 1
g = A G = A
1 1 * T
4 1 1 1 1 2 0
1 j 1 j 1 j 3 2
, x x0 , y y0
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
( x x0 , y y0 )
0 otherwise
f ( x, y ) ( x x0 , y y0 )dydx f ( x0 , y0 )
Separable: ( x x0 , y y0 ) ( x x0 ) ( y y0 )
C. Nikou – Digital Image Processing (E12)
41 2D continuous signals (cont.)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
signal f (x,y).
F ( , )
j 2 ( x vy )
f ( x, y )e dydx
F ( , )e d d
j 2 ( x vy )
f ( x, y )
y f (x,y)=δ(x)
F ( , ) j 2 ( x vy )
( x ) e dydx x
j 2 x j 2 vy
( x ) e dx e dy
ν F(μ,ν)=δ(ν)
e
j 2 vy
dy ( ) μ
y
F ( , ) j 2 ( x vy )
( x y ) e dydx x
j 2 vy
( x y)e j 2 x
dx e dy
ν F(μ,ν)=δ(μ+ν)
j 2 ( ) y
e
j 2 y j 2 y
e dy e dy μ
( )
C. Nikou – Digital Image Processing (E12)
45 2D continuous signals (cont.)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
sin(W ) sin( W )
f ( x, y) PW / 2,W / 2 ( x, y) F ( , ) W 2
(W ) ( W )
C. Nikou – Digital Image Processing (E12)
46 2D continuous signals (cont.)
• 2D continuous convolution
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
f ( x, y )* h( x, y )
f ( x , y )h( , )d d
f ( x, y ) * h( x, y) F ( , ) H ( , )
C. Nikou – Digital Image Processing (E12)
47 2D continuous signals (cont.)
• 2D sampling is accomplished by
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
SX Y ( x, y ) ( x nX , y nY )
n m
Over-sampled Under-sampled
C. Nikou – Digital Image Processing (E12)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
49
m f [m,n] m h [m,n]
1 1
3 2 1 -1 n
n
g[m, n] f [m, n]* h[m, n] f [k , l ]h[m k , n l ]
k l
n f [m,n] n h [m,n]
1 1
3 2 1 -1 m
m
l l
g [0,0]=0 g [1,1]=0
h [-k,-l] h [1-k,1-l]
3 2 3 2
k -1 1 k
-1 1
1 1
1 1
C. Nikou – Digital Image Processing (E12)
57 2D discrete convolution (cont.)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
n f [m,n] n h [m,n]
1 1
3 2 1 -1 m
m
l l
g [2,2]=3 g [3,2]=-1
h [2-k,2-l] h [3-k,2-l]
-1 13 2 k
3 21
-1 k
1 1 1 1
n f [m,n] n h [m,n]
1 1
3 2 1 -1 m
m
n g[m,n]
3 5 2
3 -1 -3
m
M1+M2-1=3
N1+N2-1=2
C. Nikou – Digital Image Processing (E12)
59 The 2D DFT
M 1 N 1 km ln
j 2
F [k , l ] f [m, n]e M N
m0 n 0
M 1 N 1 km ln
1 j 2
f [m, n]
MN
F[k , l ]e
m0 n 0
M N
0 k M 1 0 m M 1
,
0 l N 1 0 n N 1
C. Nikou – Digital Image Processing (E12)
60 The 2D DFT (cont.)
• Particularly:
– Let f [m,n] be of size M1xN1 and h[m,n] of size
M2xN2 .
– If the signals are zero-padded to size (M1+M2-
1)x(N1+N2-1) then their circular convolution will
be the same as their linear convolution and: