제 4 장 영상의 주파수 변환
Prof. Doo-Hyun Choi
Introductory Image Processing
Introductory image Processing IISL, School of EECS, KNU
영상의 주파수 변환 Fourier Transform
Fourier Transform
Discrete Fourier Transform
Properties of 2-D DFT
Fast Fourier Transform
Fourier Transform Application
Inverse Fourier Transform
Discrete Cosine Transform
Discrete Cosine Transform
DCT Application
Discrete Sine Transform
Walsh Transform
Hadamard Transform
Harr Transform
Karhunen-Loeve Transform
Wavelet Transform
Contents
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (3/38)
Fourier Transform Pair Fourier transform of f (x) :
Inverse Fourier transform:
(exist if f (x) : continuous and integrable fn. of a real variable x , F (u) : integrable)
Euler’s formula:
∴ F (u) : an infinite sum of sine and cosine terms
Fourier Transform (1/8)
{ } ( ) = ( ) = ( )
2where = − 1
ℑ f x F u
−∞∞f x e
−j πuxdx j { F u } ( ) f x −∞∞F u ej uxdu
−
= =
ℑ
1( ) ( )
2π) 2 sin(
) 2
2
cos( ux j ux
e
−j πux= π − π
Introductory image Processing IISL, School of EECS, KNU
Fourier Transform For f (x) , a real function,
where R(u) : real component, I(u) : imaginary component, u : frequency variable
Magnitude(진폭, Fourier) spectrum of f (x) :
Phase(위상) angle:
Power(전력) spectrum (spectral density) of f (x) :
Fourier Transform (2/8)
)
)
(( ) ( ) ( )
( u R u jI u F u e
j uF = + =
φ) ( ) ( )
( u R
2u I
2u
F = +
=
−
) (
) tan (
)
(
1u R
u u I
φ
) ( ) ( )
( )
( u F u
2R
2u I
2u
P = = +
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (5/38)
Example: A simple function and its Fourier spectrum Fourier transform of f (x) :
Fourier spectrum:
Fourier Transform (3/8)
[ ] [ ]
[ ]
( )
j uXuX j uX j uX j
uX X j
ux X j ux j
ux j
e u uX
A
e e
u e j
A
u e j e A
u j dx A Ae
dx e
x f u
F
π
π π π
π π
π π
π π π
π π
−
−
−
−
−
∞ −
∞
−
−
=
−
=
− −
− =
=
=
=
sin 2
2 1 ) 2
( )
(
2 0 20
2 2
( ) ( )
( uX uX )
AX e
u uX u A
F
j uXπ π π
π
πsin sin )
( =
−=
Introductory image Processing IISL, School of EECS, KNU
Two-Dimensional Fourier Transform Pair Fourier transform of f (x,y):
Inverse Fourier transform:
(exist if f (x,y) : continuous and integrable fn. of a real variable x,y , F (u,v) : integrable)
Fourier Transform (4/8)
{ } ( ) = = −∞∞ −∞∞ − ( + )
ℑ f ( x , y ) F u , v f ( x , y ) e
j2π ux vydxdy
{ } ( ) −∞∞ −∞∞ ( + )
−
= =
ℑ
1F ( u , v ) f x , y F ( u , v ) e
j2π ux vydudv
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (7/38)
Fourier Transform For f (x,y) , a real function,
where R(u,v) : real component, I(u,v) : imaginary component, u,v : frequency variables
Magnitude(진폭, Fourier) spectrum of f (x,y) :
Phase(위상) angle:
Power(전력) spectrum (spectral density) of f (x,y) :
Fourier Transform (5/8)
) , ( ) , ( )
,
( u v R
2u v I
2u v
F = +
=
−
) , (
) , tan (
) ,
(
1v u R
v u v I
φ u
) , ( ) , ( )
, ( ) ,
( u v F u v
2R
2u v I
2u v
P = = +
) ,
)
(, ( ) , ( ) , ( ) ,
( u v R u v jI u v F u v e
j uvF = + =
φIntroductory image Processing IISL, School of EECS, KNU
Example: A simple 2-D function and its Fourier spectrum (1/2)Fourier Transform (6/8)
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (9/38)
Example: A simple 2-D function and its Fourier spectrum (2/2) Fourier transform of f (x,y) :
Fourier spectrum:
Fourier Transform (7/8)
( ) ( )
[ ] [ ]
( )
( ) ( )
( )
=
− −
− −
=
−
= −
=
=
−
−
−
− −
−
−
∞ −
∞
−
∞
∞
−
+
−
vY e vY uX
e AXY uX
v e e j
u j
A v
j e u j A e
dy e
dx e
A dxdy e
y x f v
u F
vY j uX
j
vY j uX
j vy Y
X j ux j
X j ux Y j vy
vy ux j
π π π
π
π π
π π
π π
π π π
π
π π
π
sin sin
2 1 1 1 2
2 2
) , ( ,
2 2
0 2
0 2
0 0
2 2
2
( ) ( )
( ) ( )
( ) vY vY e
uX e AXY uX
v u F
vY j uX
j
π π π
π
− π − π= sin sin
,
Introductory image Processing IISL, School of EECS, KNU
Example: Some 2-D functions and their Fourier spectraFourier Transform (8/8)
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (11/38)
Sampling of a continuous functionf
(x
)Discrete Fourier Transform (1/4)
{ }
{ ( 0 ), ( 1 ), ( 2 ), , ( 1 ) }
) ( is, that , ) (
) (
) ] 1 [ ( , ), 2 ( ), (
), (
0
0 0
0 0
−
∈ Δ
+
=
Δ
− + Δ
+ Δ
+
N f f
f f x f x
x x f x f
x N
x f x x
f x x f x f
Introductory image Processing IISL, School of EECS, KNU
Discrete Fourier Transform (2/4)
Discrete Fourier Transform Pair
Discrete Fourier transform:
Inverse Fourier transform
Proof
( )
value average
: ) 1 (
) 0 (
1 ,) ( ) ( , 1 , , 1 , 0 for )
1 (
1
0
/ 1 2
0
−
=
− −
=
=
= Δ Δ
=
−
=
=
N x
N ux N j
x
x N f
F
x Δu N
u u F u F N
u e
x N f
u
F
π
( )
1( )
2 /for 0 , 1 , , 1
0
−
=
= −
=
N x
e u F x
f
j ux NN
u
π
( )
{ }
[ ] = =
=
=
=
=
−
=
−
−
=
− −
=
− −
=
−
=
− −
=
otherwise.
0 if
since ) (
) 1 (
) 1 (
) 1 (
1
0
/ 2 / 2 1
0
/ 2 / 1 2
0
/ 1 2
0
/ 1 2
0 /
1 2 0
u r e N
e u
F
e e
r N F
e e
r N F
e x N f
u F
N x
N ux j N rx j N
x
N ux j N rx N j
r
N ux N j
x
N rx N j
r N
ux N j
x
π π
π π
π π
π
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (13/38)
Discrete Fourier Transform (3/4)
Two-Dimensional Discrete Fourier Transform Pair
If M = N ,
( ) ( )
( ) ( )
= Δ
= Δ Δ
+ Δ +
=
−
=
−
=
=
−
=
−
=
=
−
=
−
=
+
−
=
−
=
+
−
y Δv N
x Δu M
y y y x x x f y x f
N y
M x
e v u F y
x f
N v
M u
e y x MN f
v u F
M u
N v
N vy M ux j M
x N y
N vy M ux j
1 and 1
,) ,
( ) , (
1 , , 1 , 0 , 1 , , 1 , 0 for )
, ( ,
1 , , 1 , 0 , 1 , , 1 , 0 for )
, 1 (
,
0 0
1
0 1
0
/ / 2 1
0 1
0
/ / 2
π π
( ) ( )
( ) , 1 ( , ) ( ) for , 0 , 1 , , 1
1 , , 1 , 0 , for )
, 1 (
,
1
0 1
0
/ 2
1
0 1
0
/ 2
−
=
=
−
=
=
−
=
−
=
+
−
=
−
=
+
−
N y
x e
v u N F
y x f
N v
u e
y x N f
v u F
N u
N v
N vy ux j N
x N
y
N vy ux j
π π
Introductory image Processing IISL, School of EECS, KNU
Discrete Fourier Transform (4/4)
Example
( ) [ ] [ ]
( ) [ ] [ ]
( ) [ ]
( ) 3 4 1 ( ) 4 1 [ 2 3 4 4 ] 4 1 [ ] 2 F(3) 4 5
4 F(2) 1
4 4 1
4 3 4 2 ) 1
4 ( 2 1
4 F(1) 5
4 2 4 1
4 3
4 2 ) 1
4 ( 1 1
4 F(0) 13 25 . 3 4 4 3 4 2 ) 1 3 ( ) 2 ( ) 1 ( ) 0 4 ( ) 1 4 (
) 1 1 (
0
2 / 9 3
2 / 3 0 4
/ 3 6
0
3 2
0 4
/ 3 4
0
2 / 3 2
/ 0
4 / 3 2
0
3 0 0 0 , 4 / 1 2
0
= +
−
= +
+ +
=
=
=
−
= +
+ +
=
=
= +
−
= +
+ +
=
=
=
= + + +
= + + +
=
=
=
−
−
−
−
=
−
−
−
−
=
−
−
−
−
=
= =
=
− −
=
j e
e e
e e
x f F
e e
e e e
x f F
j e
e e
e e
x f F
f f f f e x f e
x N f F
j j
j x
j x
j j
j x
j x
j j j
x j x
u x N N ux N j
x
π π
π π
π π
π π
π π
π π
π
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (15/38)
Properties of the 2-D DFT (1/5)
Dynamic range adjustment
[ 1 ( , ) ] where : a scaling constant
log )
,
( u v c F u v c
D = +
] 255 , 0 [ ] 10 25 . 0 , 0
[ ×
6
Introductory image Processing IISL, School of EECS, KNU
Properties of the 2-D DFT (2/5)
Separability
2-D Fourier transform 2 successive application of 1-D Fourier transform
( ) ( )
( ) ( )
( )
−
=
− −
=
− −
=
−
−
=
−
=
−
=
−
=
+
−
=
−
=
−
− −
=
−
=
+
−
=
=
−
=
=
=
−
=
=
=
1 0
/ 1 2
0
/ 1 2
0
/ 2
1 0
1 0
/ 2 /
1 2 0
1 0
/ 2
1 0
1 0
/ 2 /
1 2 0
1 0
/ 2
) , 1 (
) 1 , 1 (
,
1 , , 1 , 0 , for )
, 1 (
) , 1 (
,
1 , , 1 , 0 , for )
, 1 (
) , 1 (
,
N
x
N ux N j
y
N vy N j
x
N ux j
N
u
N
v
N vy j N
ux N j
u N
v
N vy ux j
N
x
N
y
N vy j N
ux N j
x N
y
N vy ux j
e e
y x N f
N N e
v x N F
v u F
N y
x e
v u F N e
e v u N F
y x f
N v
u e
y x f N e
e y x N f
v u F
π π
π
π π
π
π π
π
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (17/38)
Properties of the 2-D DFT (3/5)
Translation
( Proof )
(
ux v y)
N( ) ( )
j(
ux vy)
Nj
F u u v v f x x y y F u v e
e y x
f ( , )
2π 0 + 0 /⇔ −
0, −
0, −
0, −
0⇔ ( , )
− 2π 0+ 0 /( )
{ } ( ) ( ) { }
{ } ( )
( )
{ }
) ( 2
) ( 2 )
( 2 )
( ) ( 2
0 0
0 0
0 2 0 0
0
0 0
) ( ) ( 2 2
2 2
0 0
0 0 0
0
0 0 0
0 0
0
) , (
) , ( )
, (
,
,
and
, ,
) , ( )
, (
) , (
) , ( )
, ( )
, (
vy ux j
vy ux j vt
us j y
t v x s u j
vy ux j
y v v x u u j vy
ux j y v x u j y
v x u j
e v u F
e dsdt e
t s f dsdt
e t s f
y t y dt dy t y y x
s x ds dx s x x
dxdy e
y y x x f y
y x x f
v v u u F
dxdy e
y x f dxdy
e e
y x f e
y x f
+
−
+
− +
∞ −
∞
−
∞
∞
− +
+ +
∞ −
∞
−
∞
∞
−
+
∞ −
∞
−
∞
∞
−
∞
∞
−
∞
∞
−
− +
−
− +
∞ −
∞
−
∞
∞
−
+ +
=
⋅
=
=
+
=
=
=
− +
=
=
=
−
−
−
=
−
− ℑ
−
−
=
=
= ℑ
π
π π
π
π
π π
π π
( ) [ ( ) ] [ ( ) ] ( )
( )
− −
⇔
−
=
−
= + +
+
=
=
=
=
+ +
+ + +
, 2 2
)
1 )(
, ( )
, (
1 sin
cos
2 ,
If
) ( /
2
) ( )
( /
0 2 0
0 0
0 0
v N u N
F y
x f e
y x f
y x j
y x e
N e v u
y x N
y v x u j
y x y
x j N y v x u j
π
π
π
π π
( ) ( , ) : A shift does not affect the magnitude )
,
( u v e
2 0 0 /F u v
F
−j π ux+v y N=
Introductory image Processing IISL, School of EECS, KNU
Properties of the 2-D DFT (4/5)
Periodicity
) , ( ) , ( ) , ( ) ,
( u v F u N v F u v N F u N v N
F = + = + = + +
) , ( ) , ( and ) , ( ) , ( , real is
If f(x,y) F u v = F
*− u − v F u v = F − u − v
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (19/38)
Properties of the 2-D DFT (5/5)
Shuffling
n
m (0,0)
(M-1,N-1)
j
k A
D C
B
Introductory image Processing IISL, School of EECS, KNU
Fast Fourier Transform (1/8)
Computational Complexity
Direct Fourier transform: O ( N
2)
FFT: O ( Nlog
2N )
( )
−
=
−
− −
=results the
of additions
1
by of tions multiplica complex
, of values
the of each For
) 1 (
/ 2 /
1 2 0
N
e u u N
N e x N f
u F
N ux j N
ux N j
x
π π
N N2 (Direct FT) Nlog2N (FFT) N/log2N(Computational Advantage)
2 4 2 2.00
4 16 8 2.00
8 64 24 2.67
16 256 64 4.00
32 1,024 160 6.40
64 4,096 384 10.67
128 16,384 896 18.29
256 65,536 2,048 32.00
512 262,144 4,608 56.89
1024 1,048,576 10,240 102.40
2048 4,194,304 22,528 186.18
4096 16,777,216 49,152 341.33
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (21/38)
Fast Fourier Transform (2/8)
Successive doubling method
An N -point Fourier transform Two ( N/2 )-point Fourier transforms
( ) [ ]
( )
[ ]
( ) ( )
( ) 2 1 [ ( ) ( ) ] for 0 , 1 , 2 , , 1 0 , 1 , 2 , , 2 1
,
and
Since
1 , , 2 , 1 , 0 for ) 1 2 1 (
and ) 2 1 (
Defining
) ( ) 2 (
) 1 1 2 1 (
) 2 1 (
2 1
)
1 2 1 (
) 2 1 (
2 1
) 2 (
) 1 1 (
, 2 2 that Assume
/ 2 exp
where ) 1 (
2 2 2
1 0 1
0
2 2
1 0 1
0
22 ) 2 2( )
1 2 2( 1
0 )
2 2( 1
0
2 1
2 0 1
0 1 0
−
=
−
=
−
= +
−
=
=
−
= +
=
=
+
=
+ +
=
=
=
+ +
=
=
=
=
=
−
=
=
+ +
−
=
−
=
−
=
−
=
− +
=
−
=
−
=
−
=
−
=
N M
u W
u F u F M u F
W W
W W
M u
W x M f
u F W
x M f
u F
W u F u F W
W x M f
W x M f
W W
W W
x M f
W x M f
W x M f
W x N f
u F
M N
N j W
W x N f
u F
uM odd
even
uM M
uM Mu
M Mu
Mux M
x ux odd
M M
x even
uM odd
u even ux M M M
x Mux
M
x
Mux Mux
x uM x
uM M
x x
uM M
x
uxM M
x Nux
N
x
n ux N N N
x
π
Introductory image Processing IISL, School of EECS, KNU
Fast Fourier Transform (3/8)
Let m ( n ) and a ( n ): # of complex multiplications and additions (1/4)
for n = 1, N = 2, M = 1
( ) [ ]
( ) ( F ) [ F F W ] Nn Nn
F
W F
F F F W
F F
F
M odd
even
M odd
odd even M
odd even
=
=
=
=
∴
−
= +
=
+
=
2 a(1) 2 , 1 1 m(1) addition one
) 0 ( ) 0 2 (
1 1 0 1
addition one
and ) ) 0 ( ( tion multiplica one
: ) 0 (
addition and
tion multiplica no
: ) 0 (
addition and
tion multiplica no
: ) 0 ( )
0 ( ) 0 2 (
0 1
20
20 20
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (23/38)
Fast Fourier Transform (4/8)
Let m ( n ) and a ( n ): # of complex multiplications and additions (2/4)
for n = 2, N = 4, M = 2
( ) ( ) ( ) ( )
Nn )
a(
) a(
Nn )
m(
) m(
F F F
F
a m
=
= +
=
=
= +
=
∴ , 2 2 1 4 8
2 4 1 2 1 2 2
additions
more 2 : 3 , 2 additions,
and tions multiplica
further
2 : 1 , 0
) 1 ( 2 ), 1 ( 2 : transform
point - 2 Two
Introductory image Processing IISL, School of EECS, KNU
Fast Fourier Transform (5/8)
Let m ( n ) and a ( n ): # of complex multiplications and additions (3/4)
for n = 3, N = 8, M = 4
( ) ( ) ( ) ( )
Nn )
a(
) Nn, a(
) m(
) m(
F F
F F
a m
=
= +
=
=
= +
=
∴ 3 2 2 8 24
2 12 1 4 2 2 3
additions
more 4 : 7 , , 4 additions,
and tions multiplica further
4 : 3 , , 0
) 2 ( 2 ), 2 ( 2 : nsform point tra -
4 Two
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (25/38)
Fast Fourier Transform (6/8)
Let m ( n ) and a ( n ): # of complex multiplications and additions (4/4)
For N -point FFT, n = log
2N, M = N/2
Number of Operations
(Proof by induction)
0 ) 0 ( and 0 ) 0 ( where 2 1 2 2
1
2 − +
1= − + = =
=
∴ m(n) m(n )
n−, a(n) a(n )
nm a
1 for log
2 log 2 ) ( 2 ,
log 1 2 2 1 log 2 2
) 1
( n =
2= N
2N = Nn a n =
2= N
2N = Nn n ≥
m
n n n n( ) ( ) ( )
( ) ( ) ( )
true.
is ) ( and 2
) 1 (
1 2
2 2 2 2 2
2 ) ( 2 ) 1 (
1 2 2
1 1 2 2 2 2
2 1 2 2
2 1 2 ) ( 2 ) 1 (
, 1 For
true.
is ) ( and 2
) 1 ( that Assume
. 2 ) 1 )(
2 ( ) 1 ( and 1 ) 1 )(
2 2 ( ) 1 1 ( , 1 For
1 1 1
1
1
Nn n a Nn n
m
n n
Nn n
a n
a
n n
n Nn
n m n
m n
Nn n a Nn n
m
a m
n
n n n n
n
n n
n n n
n
=
=
∴
+
= +
= +
= +
= +
+
= +
= +
= +
= +
= + +
=
=
=
=
=
=
=
+ + +
+
+
Introductory image Processing IISL, School of EECS, KNU
Fast Fourier Transform (7/8)
Implementation
Bit reversal
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (27/38)
Fast Fourier Transform (8/8)
2-D FFT Example
원영상 진폭 스펙트럼 위상
Introductory image Processing IISL, School of EECS, KNU
Fourier Transform Application
Frequency in an image: variation of intensity levels
Edges have relatively high frequency components
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (29/38)
Inverse Fourier Transform
Inverse FFT
Inverse FFT = Take the complex conjugate and multiply by N
2-D Inverse FFT
( ) ( )
( )
N j ux Nx
N ux N j
x N
ux N j
x
e u N F
x N f
e u F x
f e
x N f
u F
/ 1 2
0
*
*
/ 1 2
0 /
1 2 0
) 1 (
1
) (
and )
1 (
π
π π
− −
=
−
=
− −
=
=
=
=
( ) ( )
( ) ( )
( ) , 1 * ( , ) ( ) for , 0 , 1 , , 1
1 , , 1 , 0 , for )
, 1 (
,
1 , , 1 , 0 , for )
, 1 (
,
1
0 1
0
/ 2
*
1
0 1
0
/ 2
1
0 1
0
/ 2
−
=
=
−
=
=
−
=
=
−
=
−
=
+
−
−
=
−
=
+
−
=
−
=
+
−
N y
x e
v u N F
y x f
N y
x e
v u N F
y x f
N v
u e
y x N f
v u F
N u
N v
N vy ux j N
u N
v
N vy ux j N
x N y
N vy ux j
π π
π
Introductory image Processing IISL, School of EECS, KNU
Discrete Cosine Transform (1/4)
1-D Discrete Cosine Transform Pair ( N = 2
n)
2-D DCT Pair ( N = 2
n)
Separable DCT kernels 2D DCT = successive applications of 1D DCT
( ) [ ]
( ) [ ]
−
=
=
=
−
∈
+
=
−
∈
+
=
−
=
−
=
. 1 , , 2 , 1 2 for
0 1 for )
( where 1 , , 1 , 0 for 2
) 1 2 cos ( ) ( ) (
1 , , 1 , 0 for 2
) 1 2 cos ( )
( ) (
1 0
1
0
N N u
N u u
N N x
u u x
C u x
f
N N u
u x x
f u u C
N
u N
x
π α
α α π
( ) [ ]
( ) , ( ) ( ) ( , ) cos ( 2 2 1 ) cos ( 2 2 1 ) for , [ 0 , 1 , , 1 ]
1 , , 1 , 0 , for 2
) 1 2 cos ( 2
) 1 2 cos ( , )
( ) ( ) , (
1 0
1 0
1 0
1 0
−
∈
+
+
=
−
∈
+
+
=
−
=
−
=
−
=
−
=
N y
N x v y N
u v x
u C v u y
x f
N v
N u v y N
u y x
x f v
u v u C
N
u N
v N
x N
y
π
α π α
π α π
α
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (31/38)
Discrete Cosine Transform (2/4)
Implementation
( )
FFT point 2
2 :
exp 2 ) ( that Note 2
exp 2 ) 2 (
exp Re ) (
1 2 , , 1 , when 0
) (
and 1 , , 1 , 0 where
2 ) 1 2 exp ( ) ( Re
) (
2 ) 1 2 exp ( ) ( Re
) (
2 ) 1 2 cos ( )
( ) (
1 2
0 1
2
0 1
2
0 1
0 1
0
N N- ux x j
N f ux x j
N f u u j
N N
N x x
f
N u
N u x x j
f u
N u x x j
f u
N u x x
f u u
C
N
x N
x N
x N
x N
x
−
=
−
=
−
=
−
=
−
=
−
−
⋅
−
⋅
=
− +
=
=
−
=
− +
⋅
=
− +
⋅
=
+
=
π π
α π α π α π α π
Introductory image Processing IISL, School of EECS, KNU
Discrete Cosine Transform (3/4)
Example
( ) ( )
( ) { }
( ) ( )
( )
0.1128 cos 21 ) 4 8 ( cos 15 ) 2 8 ( cos 9 ) 1 8 ( cos 3 ) 0 4 ( 2 4
2 3 ) 1 2 cos ( )
1 ( ) 1 (
5 . 8 0 cos 14 ) 4 8 ( cos 10 ) 2 8 ( cos 6 ) 1 8 ( cos 2 ) 0 4 ( 2 4
2 2 ) 1 2 cos ( )
2 ( ) 2 (
577 . 8 1 cos 8 ) 4 8 ( cos 5 ) 2 8 ( cos 3 ) 1 8 ( cos ) 0 4 ( 2 4
2 1 ) 1 2 cos ( )
1 ( ) 1 (
5 . 6 ) 4 ( ) 2 ( ) 1 ( ) 0 4 ( 1 4
2 0 ) 1 2 cos ( )
0 ( ) 0 (
4 2
) 1 2 cos ( )
2 ( ) 1 2 cos ( )
( ) (
1 4
0 1 4
0 1 4
0 1 4
0
1 4
0 1
0
=
+
+
+
⋅
=
⋅
= +
−
=
+
+
+
⋅
=
⋅
= +
−
=
+
+
+
⋅
=
⋅
= +
= + + +
⋅
=
⋅
= +
⋅
= +
+
=
−
=
−
=
−
=
−
=
−
=
−
=
π π
π π π
α
π π
π π
α π
π π
π π
α π α π
α π α π
f f
f x f
x f C
f f
f x f
x f C
f f
f x f
x f C
f f f x f
x f C
u x x
f N u
u x x
f u u C
x x x x
x N
x
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (33/38)
Discrete Cosine Transform (4/4)
Example
Introductory image Processing IISL, School of EECS, KNU
DCT Application (1/4)
JEPG and MPEG
Steps of the lossy sequential DCT-based coding mode
Not DFT, but DCT! Why?
DCT uses smaller coefficients
DCT have more efficient energy compaction capability
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (35/38)
DCT Application (2/4)
1-D Example
Introductory image Processing IISL, School of EECS, KNU
DCT Application (3/4)
2-D Example (1/2)
21 21 22 171 229 229 222 218
21 20 17 104 221 224 228 225
20 21 13 43 196 210 217 215
20 19 14 26 143 213 212 208
15 18 19 56 109 148 195 174
18 17 38 98 119 122 132 110
17 25 82 118 118 116 113 109
19 61 108 122 118 114 113 107
⎯
⎯
⎯
⎯
⎯ →
⎯
⎯
⎯ →
⎯
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 90 335 253
0 0 0 0 0 44 567 855
0 0 0 0 0 626 2818 6831
567 44 226 114 307 277 1168 855
335 90 110 122 146 228 189 253
186 128 55 90 10 58 287 212
184 108 50 35 50 108 184 169
287 58 10 90 55 128 186 212
189 228 146 122 110 90 335 253
1168 277 307 114 226 44 567 855
2818 626 732 533 732 626 2818 6831
21 21 22 171 229 229 222 218
21 20 17 104 221 224 228 225
20 21 13 43 196 210 217 215
20 19 14 26 143 213 212 208
15 18 19 56 109 148 195 174
18 17 38 98 119 122 132 110
17 25 82 118 118 116 113 109
19 61 108 122 118 114 113 107
n CompressioTruncationfor DFT
−
−
−
−
−
−
⎯
⎯
⎯
⎯
⎯ →
⎯
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
−
⎯
⎯ →
⎯
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 96 60 61
0 0 0 0 0 17 195 149
0 0 0 0 0 81 513 853
6 6 3 3 11 5 2 2
0 7 4 4 4 10 14 6
5 15 1 1 6 9 0 1
14 0 7 16 9 17 10 17
25 18 38 31 12 32 18 18
19 7 12 36 42 96 60 61
1 20 35 35 95 17 195 149
11 23 18 23 98 81 513 853
21 21 22 171 229 229 222 218
21 20 17 104 221 224 228 225
20 21 13 43 196 210 217 215
20 19 14 26 143 213 212 208
15 18 19 56 109 148 195 174
18 17 38 98 119 122 132 110
17 25 82 118 118 116 113 109
19 61 108 122 118 114 113 107
n CompressioTruncationfor DCT
Introductory image Processing Lecture Note 04
IISL, School of EECS, KNU (37/38)
DCT Application (4/4)
2-D Example (2/2)
110 72 87 117 137 154 166 152
111 66 87 121 141 159 171 158
101 59 81 112 130 149 162 148
95 53 71 103 125 146 156 140
87 42 69 107 130 145 151 132
70 38 78 112 126 133 135 116
67 53 86 108 114 120 123 106
90 69 88 108 119 132 141 126
9 26 85 148 196 224 234 235
8 20 70 126 175 210 229 237
6 13 49 95 143 186 219 236
2 10 35 71 116 161 200 221
4 15 36 66 103 141 173 191
12 27 52 81 108 129 142 148
20 41 74 105 122 124 115 107
24 51 90 122 134 122 99 81
21 21 22 171 229 229 222 218
21 20 17 104 221 224 228 225
20 21 13 43 196 210 217 215
20 19 14 26 143 213 212 208
15 18 19 56 109 148 195 174
18 17 38 98 119 122 132 110
17 25 82 118 118 116 113 109
19 61 108 122 118 114 113 107
Introductory image Processing IISL, School of EECS, KNU
Practice
Fourier Transform을 구현하시오.
Discrete Fourier transform을 구현하시오.
Fast Fourier transform을 구현하시오 (강의노트 p. 27 참조)
Discrete Cosine Transform을 구현하시오.
Discrete Cosine Transform을 구현하시오.
FFT를 이용하여 DCT를 구현하시오.
DCT Application의 Example들 (강의노트 pp. 35-37)을 구현해서 확인하시오.