Anda di halaman 1dari 32

Modern Approaches to

Digital Image Processing


Lecture 2
Dr.-Ing. Patrick Ndjiki-Nya
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e

2
Outline
Image quantization
Fourier transform
Sampling theorem
2D sampling
Separable
Non-separable
3D sampling
Progressive
Interlaced
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e

3
Image Quantization
Discretization of a continuous signal in spatial and
intensity domains
Spatial domain:
Pixel size smaller than smallest image object
Pixel size smaller than spatial resolution of visual system of
the observer at a given distance
256 x 240 128 x 120 64 x 60 32 x 30
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e

4
Image Quantization
Intensity domain
Mapping onto intervals
By default 8 bits (computer architecture) 256 intervals
Too little gray-levels false edges
Higher image quality higher memory requirements and
computational time, and the other way around
8 Bit 6 Bit 4 Bit 2 Bit
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e

5
Fourier Transform
Image representation
Local representation (spatial domain)
Global representation in a transformed space (frequency domain)
Convertibility of both representations into each other
Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10
s
l
i
d
e

6
1D Fourier Series
Definition: A Fourier series decomposes a continuous
periodic spatial/time signal into the sum of simple
oscillating functions yielding a discrete representation
in the frequency domain.
Definition of a 1D periodic function
with wavelength (period ) :
with a
k
and b
k
(amplitudes of the separate sine and
cosine functions)
) ( ) (
x
k x f x f + =
t 2 =
x
| | e + + =

=
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

1D Fourier Series (general case,


x
2)

|
|
.
|

\
|
+
|
|
.
|

\
|
+ =
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

Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10


s
l
i
d
e

1
0
1D Fourier Transform
Limit
x
; valid for every real, non-periodic function
Fourier-Transform:
with , [cm], [cm
-1
]
Inverse Fourier-Transform:
Summary:
Fourier Series: discrete frequency spectrum c
k
of f(x)
Fourier Transform: continuous frequency spectrum F(
x
) of f(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

Dr.-Ing. P. Ndjiki-Nya Modern Approaches to Digital Image Processing, SS10


s
l
i
d
e

1
1
1D Discrete Fourier Transform
Digital Image processing continuous Fourier
Transform
Sampling of the continuous function f(x) at x=0,1,,N-1:
Discrete Fourier Transform (DFT):
Inverse discrete Fourier Transform (IDFT):
collision
) ( ) (
)) 1 ( ( ) 1 ( ) 1 ( ) 1 ( ) ( ) 0 ( ) (
1
0
k x k f
N x N f x f x f x f
N
k
=
= + + + =

=
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
!

Anda mungkin juga menyukai