Digital Image Processing
Digital Image Processing
=
k kx b kx a
a
x f
k
k k
, ) sin( ) cos(
2
) (
1
0
dx x f a
=
t
t
2
0
0
) (
1
0 , ) cos( ) (
1
2
0
> =
k dx kx x f a
k
t
t
0 , ) sin( ) (
1
2
0
> =
k dx kx x f b
k
t
t
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
7
1D Fourier Series (example)
Better representation of original signals with high k (ideal
case k=)
Original signal
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
8
1D Fourier Series (complex representation)
Compact representation with complex exponential
functions
Euler-identity:
Complex representation:
) sin( ) cos( kx i kx e
x k i
+ =
) sin( ) cos( kx i kx e
x k i
=
x k i
k
k
e c x f
=
= ) (
>
=
<
= =
0 ), (
2
1
0 ,
2
0 ), (
2
1
) (
2
1
0
2
0
k ib a
k
a
k ib a
dx e x f c
k k
k k
x k i
k
t
t
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
9
Fourier-series:
Coefficients (amplitudes) a
k
and b
k
:
Complex representation:
dx x f a
x
x
0
0
) (
2
0 ,
2
sin ) (
2
0
>
|
|
.
|
\
|
=
k dx
kx
x f b
x
x x
k
0 ,
2
cos ) (
2
0
>
|
|
.
|
\
|
=
k dx
kx
x f a
x
x x
k
|
|
.
|
\
|
+
|
|
.
|
\
|
+ =
1
0
2
sin
2
cos
2
) (
k
x
k
x
k
kx
b
kx
a
a
x f
t
x
x k i
k
k
e c x f
t 2
) (
=
=
>
=
<
= =
0 ), (
2
1
0 ,
2
0 ), (
2
1
) (
1
0
0
2
k ib a
k
a
k ib a
dx e x f c
k k
k k
x k i
x
k
x
x
= dx e x f F
x i
x
x
e
e ) ( ) (
=
x
x i
x
d e F x f
x
e e
e
) ( ) (
x
f
x
x x
f
t
t e
2
2 = =
x
=
o
o o o
=
=
=
0 , 0
0 , 1
) (
x
x
x o Dirac function:
= = =
1
0
2
) 1 ( 2 , , 2 , 0 2 , ) (
1
) 2 (
N
x
x x
x f
N
i
x
N f e x f
N
f F
x
t t t e t
t
=
= =
1
0
2
1 , , 1 , 0 , ) 2 ( ) (
N
f
x f
N
i
x
x
x
N x e f F x f
t
t
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
2
1D Discrete Fourier Transform
Magnitude and phase spectrum
Fourier Transform in general complex form:
Magnitude spectrum of F(
x
):
conjugate of
Phase spectrum of F(
x
):
) 1 ( 2 , , 2 , 0 , ) ( ) ( ) ( ) ( ) (
2 2
= = + =
-
N F F I R F
x x x x x x
t t e e e e e e
) ( ) ( ) (
x x x
I i R F e e e + =
) 1 ( 2 , , 2 , 0 ,
) (
) (
arctan ) ( = = N
R
I
x
x
x
x
t t e
e
e
e o
) ( *
x
F e ) (
x
F e
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
3
2D DFT
2D Discrete Fourier Transform (DFT):
2D Inverse Discrete Fourier Transform (IDFT):
Magnitude spectrum: Phase spectrum:
) 1 ( 2 , , 2 , 0 ); 1 ( 2 , , 2 , 0
, ) , (
1
) , (
1
0
1
0
2
= =
=
=
|
|
.
|
\
|
+
M N
e y x f
MN
F
y x
N
x
M
y
M
f y
N
f x
i
y x
y
x
t t e t t e
e e
t
=
|
|
.
|
\
|
+
=
=
=
1
0
1
0
2
1 , , 1 , 0
1 , , 1 , 0
, ) 2 , 2 ( ) , (
N
f
M
f
M
f y
N
f x
i
y x
x y
y
x
M y
N x
e f f F y x f
t
t t
) , ( ) , ( ) , (
2 2
y x y x y x
I R F e e e e e e + =
) , (
) , (
arctan ) , (
y x
y x
y x
R
I
e e
e e
e e o =
x
y
x
y
M
N
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
4
2D DFT (properties)
Periodicity:
Symmetry:
Faltungssatz
); , ( ) , ( ) , ( ) , (
y x y x y x y x
lM kN F lM F kN F F e e e e e e e e + + = + = + =
); , ( * ) , (
y x y x
lM kN F F e e e e =
1 , > l k
1 , > l k
; ) , ( ) , (
y x y x
lM kN F F e e e e =
1 , > l k
A B
C D
A B
C D
A B
C D
A B
C D
A B
C D
A B
C D
A B
C D
A B
C D
A B
C D
M
2M
3M
0
0 N 2N 3N
) , ( ) , ( ) , ( * ) , ( y x y x G F y x g y x f e e e e
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
5
2D DFT (properties)
Translation: shift of a function in the spacial domain
rotation of the phase
Original Amplitude Phase
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
6
2D DFT (properties)
Rotation: rotate a function in the spacial domain
same rotation in the magnitude spectrum
Original Amplitude Phase
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
7
Sampling Theorem
Sampling: spatial domain
Sampled analog waveform
( ) ( ) e A =
=
x k x x f x f
n
x sampled
, ) ( o
impulse train
f(x)
x
x
( ) x f
sampled
x
: sampling period
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
8
Sampling Theorem
Sampling: frequency domain
( ) k ) (
=
A
A =
k
x
x x
x
o o
) ( ) ( x x f
x
A
o
max max max
2 2 2 2 if only and if gap f f f f f
x x
> <
A A
t t t
e
X
F
sampled
(e
X
)
2e
X
e
X
-2tf
xmax
e
X
F(e
X
)
2tf
xmax
x
x x
f
A
= =
A A
t
t e
2
2
( )
2
) (
2
=
A
A
=
A
A
l
x
x
x
x
x x
le e o
t
e o
t
e
) (
2
) (
2
1
x
x
x
x
F e o
t
e
t
e
A
A
-
) (x f
sampled
=
A
A
=
l
x
x
x sampled
x
l F F ) (
1
) ( e e e
e
X
2e
X
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
1
9
Sampling Theorem
Shannon-Nyquist's sampling theorem:
A sampled time signal must not contain components at
frequencies above half the sampling rate (The so-called Nyquist
frequency)
The highest frequency which can be accurately represented is
one-half of the sampling rate
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
0
Sampling Theorem 2D
Sampling: spatial domain
( ) ) , ( ) , ( ,
,
y x y x f y x f
y x
sampled A A
= o
=
A A A A
A A = =
m n
y x
n y m x y x y x
y x y x
) , ( ) ( ) ( ) , (
,
o o o o
x
x
x
y
y y
x
) , (
,
y x
y x
A A
o ) (x
x
A
o
) ( y
y
A
o
Dirac line impulses
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
1
Sampling Theorem 2D
Sampling: frequency domain
=
A A
A A
=
A A
A A
k l
y x
y x
y x
y x
y x
y x
l k ) , (
4
) , (
4
2
,
2
e e e e o
t
e e o
t
e e
) , ( ) , (
,
y x y x f
y x
A A
o
=
A A
A A =
m n
y x
n y m x y x
y x
) , ( ) , (
,
o o
A A
-
A A
) , (
4
) , (
4
1
,
2
2
y x
y x
y x
y x
F e e o
t
e e
t
e e
( ) y x f
sampled
,
=
A A
A A
k l
y x
y x
y x
l k F ) , (
1
e e e e
x x
f
x
A A
=
A
= t
t
e 2
2
y y
f
y
A A
=
A
= t
t
e 2
2
x
e
y
e
) , (
y x
F e e
2
y
A
e
2
x
A
e
A
Theorem conditions:
max x
e
max y
e y
y
y
y
f
A
= = <
A
A t
t
e
e
2
max
x
x
x
x
f
A
= = <
A
A
t
t
e
e
2
max
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
2
2D Sampling
Coodrdinate system mapping
Expressing the relationship between signal domain and
frequency domain using mapping (sampling) matrix
Possible over different dimensions
Separable and non-separable sampling
| |
n
m
n
m
d d
d d
n m y
n m x
1 0
11 10
01 00
) , (
) , (
d d
Basis vectors
Indexing vectors ( )
Sampling matrix
Current sampling position (of the
spatially continuous signal)
e n m,
x,m
y,n
y
x
example
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
3
2D Sampling
Sampling matrix
Spatial domain:
Frequency domain:
Relationship: Conditions:
| |
| |
| |
=
=
=
=
T
11 01 1
T
10 00 0
1 0
11 10
01 00
,
,
d d
d d
d d
d d
d
d
d d D
| |
| |
| |
=
=
=
=
T
11 01 1
T
10 00 0
1 0
11 10
01 00
,
,
f f
f f
f f
f f
f
f
f f F
| |
| |
T
1 T 1
T
1 T 1
= =
= =
F D D F
D F F D
j i
j i
i j
i j
= =
= =
for 1
for 0
T
T
d f
d f
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
4
2D Sampling: Quadrangular Sampling
Separable 2D sampling
Sampling matrices
Sampling theorem (avoiding aliasing)
y
x
y
x
A
A
=
A
A
=
y
x
y
x
rect rect
t
t
2
0
0
2
0
0
F D
y
2
y A
e
2
x A
e
) , ( y x f ) , (
y x
F e e
f(x, y) - band limited before sampling
y x
F
x
y x
A
= >
A
= > =
A
t
e
e
t e
e e e
2
or
2
for 0 ) , (
y
y
x
!
independent formulation for the horiz. and vert. spectral/spatial dimensions
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
5
2D Sampling: Shear Sampling
Non-separable 2D sampling
Sampling matrices
Sampling theorem (avoiding aliasing)
A A
A
=
A
A A
=
y x
x
y
x x
shear shear
t tv
t
v
2 2
0
2
0
F D
) , ( y x f ) , (
y x
F e e
f(x, y) - band limited before sampling
y x
y
x
F
y x
A
>
A
A
+
A
> =
t
e
v
e
t
e e e
x y x
!
or for 0 ) , (
y
x
y
x
y
y A
e
2
x A
e
{ }
Z
R
e
e
v
v
sampling r rectangula
0 \ sampling shear
1 = v
dependent formulation for the horiz. and vert. spectral/spatial dimensions
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
6
2D Sampling: Hexagonal Sampling
Non-separable 2D sampling
Sampling matrices
Sampling theorem (avoiding aliasing)
A
=
A =
1
2
1
0
2
3
2
1 0
3
1
3
2
y
y
hex hex
t
F D
) , ( y x f ) , (
y x
F e e
f(x, y) - band limited before sampling
y
y
F
y
x y x
A
> +
A
> =
3
2
3
or for 0 ) , (
y
!
t
e
e
t
e e e
y
x
y
x
y
2
y A
e
2 3
y A
e
-Same distances towards
six neighbors
- Only one free parameter (y)
dependent formulation for the horiz. and vert. spectral/spatial dimensions
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
7
2D Sampling: Quincunx Sampling
Non-separable 2D sampling
Sampling matrices
Sampling theorem (avoiding aliasing)
A
=
A =
1
2
1
0
2
1
2
1 0
1 2
y
y
quin quin
t
F D
) , ( y x f ) , (
y x
F e e
f(x, y) - band limited before sampling
y
F
y x
A
> + =
t
e e e e
y x
!
for 0 ) , (
-Same distances towards
four neighbors
- Only one free parameter (y)
y
x
y
x
y
2
y A
e
2
y A
e
dependent formulation for the horiz. and vert. spectral/spatial dimensions
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
8
2D Sampling: Summary
Shear Sampling
Allows reconstruction of signals that would violate sampling
conditions of quadrangular scheme
Limitation: some frequency components are forbidden
Quincunx Sampling
Pure horizontal and vertical sinusoids can be reconstructed with
half the samples required for quadrangular sampling
Lower maximum allowable frequency for diagonal sinusoid
orientation
Hexagonal Sampling
(Almost) omnidirectional sampling scheme
Number of samples reduced by factor 0.87 compared to
quadrangular sampling scheme
No major disadvantages
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
2
9
3D Sampling: Video
Coorddinate system mapping (3D)
| |
o
n
m
o
n
m
d d d
d d d
d d d
o n m t
o n m y
o n m x
2 1 0
22 21 20
12 11 10
02 01 00
) , , (
) , , (
) , , (
d d d
y,n
x,m
t,o
y
x
M
N
t
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
3
0
3D Sampling: Progressive
Progressive sampling (e.g. film scanning)
Sampling matrix
Sampling theorem (avoiding aliasing)
A
A
A
=
t
y
x
prog
0 0
0 0
0 0
D
y,n
x,m
t,o
y
x
M
N
t
y
t
t
y
1 2 3 4
frame nr.
) , , ( t y x f ) , , (
z y x
F e e e
f(x, y, t) - band limited before sampling
t y x
F
y
x
z y x
A
= >
A
= >
A
= > =
A
A
A
t e
e
t
e
e
t e
e e e e
2
or
2
or
2
when 0 ) , , (
t
t y x
!
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
3
1
3D Sampling: Interlaced
Interlaced sampling (e.g. analog video)
Sampling matrix
Sampling theorem (avoiding aliasing)
A
A A
A
=
2
0 0
2 0
0 0
t
y y
x
inter
D
y,n
x,m
t,o
y
x
M
N
t
) , , ( t y x f ) , , (
z y x
F e e e
f(x, y, t) - band limited before sampling
t y y t x
F
x
z y x
A A
>
A
+
A A
= > =
A
t
e
e
t e
e e e e
2
or
2
when 0 ) , , (
t
y
x
!
y
t
t
y
1 2 3
frame Nr.
e o e o e o e
e even sampling (field)
o odd sampling (field)
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e
3
2
Interlaced sampling (e.g. analog video)
Sampling matrix
Sampling theorem (avoiding aliasing)
A
A
A
=
2
0 0
2 0
0 0
t
S y
x
inter
D
3D Sampling: Interlaced
y,n
x,m
t,o
y
x
M
N
t
) , , ( t y x f ) , , (
z y x
F e e e
f(x, y, t) - band limited before sampling
x
t
t
y
1 2 3
frame Nr.
e o e o e o e
Similar to quincunx
sampling!
t y y t x
F
x
z y x
A A
>
A
+
A A
= > =
A
t
e
e
t e
e e e e
2
or
2
when 0 ) , , (
t
y
x
!