Chapter3 Image Transforms - USTChome.ustc.edu.cn/~xuedixiu/image.ustc/course/dip/DIP14...Chapter3...
Transcript of Chapter3 Image Transforms - USTChome.ustc.edu.cn/~xuedixiu/image.ustc/course/dip/DIP14...Chapter3...
Chapter3 Image Transforms
• Preview3 1G l I d i d Cl ifi i• 3.1General Introduction and Classification
• 3.2 The Fourier Transform and Propertiesh bl f• 3.3 Other Separable Image Transforms
• 3.4 Hotelling Transform
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
1
Chapter3 Image Transforms
PreviewGeneral steps of operation in frequency domain
DFT IDFT),( vuH
General steps of operation in frequency domain
Pre- Post-
),( vuF ),(),( vuHvuF
Preprocessing
Postprocessing
)(f )( yxg),( yxf ),( yxg
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
2
Chapter3 Image Transforms
Preview
Lowpass filterLowpass filter And highpass filter
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
3
Chapter3 Image Transforms
PreviewDirectly display DFT coefficientsDirectly display DFT coefficients
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
4
Chapter3 Image Transforms
PreviewDisplay DFT coefficients after log operateDisplay DFT coefficients after log operate
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
5
Chapter3 Image Transforms
Preview Rotational properties of DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
6
Chapter3 Image Transforms
Preview Examples of DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
7
Chapter3 Image TransformsChapter3 Image TransformsPreview Blurred image and its DFTPreview Blurred image and its DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
8
Chapter3 Image TransformsChapter3 Image TransformsPreview Blurred image and its DFTPreview Blurred image and its DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
9
Chapter3 Image TransformsChapter3 Image TransformsPreview Blurred image and its DFTPreview Blurred image and its DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
10
Chapter3 Image Transforms
Preview Examples of DCT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
11
3.1 General Introduction and Classification3.1.1 introduction
• image transforms are the bases of image processing g g p gand analysis
• this chapter deals with two-dimensional transforms and their propertiesp p
• image transforms are used in image enhancement, g g ,restoration, reconstruction, encoding and description
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
12
3.1 General Introduction and Classification3.1.1 classification
DFT and its properties⎧ ⎧ DFT and its propertiesDCT
Hadamard Transform
⎧ ⎧⎪ ⎪
⎧⎪ ⎪⎪⎪ ⎪⎪ ⎪Hadamard Transform
separable transformsimage transforms others Walsh Transform
Slant Transform
⎪ ⎪⎪ ⎪⎪ ⎨ ⎪⎨ ⎨⎪
⎪⎪⎪
⎪
⎪⎪ Slant Transform
Haar Transform
statistical transforms: Hotelling transform
⎪⎪⎪⎪⎪ ⎩⎩
⎪⎪⎪⎪⎩ statistical transforms: Hotelling transform⎪⎩
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
13
3.2 Fourier Transform and Properties3.2.1 introduction
Optical PrismOp c s
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
14
3.2 Fourier Transform and Properties3.2.1 introduction
DFT
Mathematic Prisme c s
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
15
3.2 Fourier Transform and Properties3.2.2 definitions: 1-D CFT
The One-Dimensional Continuous Fourier Transform and its Inverse
2( ) ( ) j uxF u f x e dxπ+∞ −= ∫( ) ( )f−∞∫
2( ) ( ) j xuf x F u e duπ+∞
∞= ∫−∞∫
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
16
3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT
The One-Dimensional Discrete Fourier Transform and its Inverse
21N j uxπ− −
∑ 0 1 1u N=0
( ) ( )j ux
N
x
F u f x e=
=∑ 0,1, 1u N= −L
21
0
1( ) ( )N j ux
Nf x F u eN
π−
= ∑ 0,1, 1x N= −L0uN =
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
17
Basis function DFT N=64Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang18
Basis function DFT N=64
3.2 Fourier Transform and Properties3.2.2 definitions (2) :1-D DFT
Other expressions:
)()()( ujIuRuF +=
[ ])()()( jFF φor
[ ])(exp)()( ujuFuF φ=
E l ’ f lEuler’s formula:
[ ] uxjuxuxj πππ 2sin2cos2exp −=−Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang19
[ ]
3.2 Fourier Transform and Properties3.2.2 definitions:spectrum, Phase angle Power spectrum
Magnitude or spectrum [ ] 21
)()()( 22 uIuRuF +=Magnitude or spectrum
Ph l h t
[ ])()()( uIuRuF +=
[ ])()(arctan)( uRuIu =φPhase angle or phase spectrum [ ])()(arctan)( uRuIu =φ
)()()()( 222Power spectrum(Spectral density)
)()()()( 222 uIuRuFuP +==
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
20
3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
If a signal is expressed as f(x)={2,3,4,4}, its DFT are:3
0(0) ( ) exp(0) (0) (1) (2) (3) 13
xF f x f f f f
=
= = + + + =∑3
0 / 2 3 / 2
0(1) ( ) exp( 2 / 4) 2 3 4 4 2j j j
xF f x j x e e e e jπ π ππ − − −
=
= − = + + + = − +∑33
0 2 3
0(2) ( ) exp( 4 / 4) 2 3 4 4 1j j j
xF f x j x e e e eπ π ππ − − −
=
= − = + + + = −∑3
/ /∑ 0 3 / 2 3 9 / 2
0(3) ( ) exp( 6 / 4) 2 3 4 4 2j j j
xF f x j x e e e e jπ π ππ − − −
=
= − = + + + = − −∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
21
3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
And the Fourier spectra are :p
(0) 0φ =| (0) | 13F = ( )φ
(1) 0.85φ π=2 2 1/ 2| (1) | [( 2) 1 ] 5F = − + =
(3) 0 85φ π= −(3)φ π=
2 2 1/ 2| (3) | [( 2) ( 1) ] 5F = − + − =
2 1/ 2| (2) | [( 1) ] 1F = − =
(3) 0.85φ π= −| (3) | [( 2) ( 1) ] 5F = − + − =
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
22
3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
Graphic illustration :
|F(u)|
p
f(x) jF(u)
u0 1 2 3
Φ(u)
x0 1 2 3
Φ(u)π
-0.85π
0 1 2 3-0.85π0 u
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
23
Fourier Transform and Properties3.2.2 definitions:1-D DFT exampleIf a signal is expressed as f(x)={3,2,3,1,4,5,0,2}, its DFT are:
7
0(0) ( ) exp(0) (0) (1) (2) (3)
xF f x f f f f
=
= = + + +∑(4) (5) (6) (7) 20f f f f+ + + + =
70 / 4 / 2 3 / 4(1) ( ) exp( 2 / 8) 3 2 3 1 4j j j jF f x j x e e e e eπ π π ππ − − − −= − = + + + +∑
0
5 / 4 3 / 2 7 / 4
(1) ( ) exp( 2 / 8) 3 2 3 1 4
5 0 2 2.4142 0.1716x
j j j
F f x j x e e e e e
e e e jπ π π
π=
− − −
= = + + + +
+ + + = − −
∑
70 / 2 3 / 2 2
0(2) ( ) exp( 4 / 8) 3 2 3 1 4j j j j
xF f x j x e e e e eπ π π ππ − − − −
=
= − = + + + +∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
245 / 2 3 7 / 25 0 2 4 4j j je e e jπ π π− − −+ + + = −
70 3 / 4 3 / 2 9 / 4 3
0
(3) ( ) exp( 6 / 8) 3 2 3 1 4j j j jF f x j x e e e e eπ π π ππ − − − −= − = + + + +∑0
15 / 4 9 / 2 21 / 45 0 2 0.4142 5.8284x
j j je e e jπ π π
=
− − −+ + + = +7
0 2 3 4
0
5 6 7
(4) ( ) exp( 8 / 8) 3 2 3 1 4
5 0 2 0
j j j j
x
j j j
F f x j x e e e e e
e e e
π π π π
π π π
π − − − −
=
− − −
= − = + + + +
+ + + =
∑5 0 2 0e e e+ + + =
70 5 / 4 5 / 2 15 / 4 5
0
(5) ( ) exp( 10 / 8) 3 2 3 1 4j j j j
x
F f x j x e e e e eπ π π ππ − − − −
=
= − = + + + +∑0
25 / 4 15 / 2 35 / 45 0 2 0.4142 5.8284x
j j je e e jπ π π
=
− − −+ + + = −7
0 3 / 2 3 9 / 2 6j j j jπ π π π∑ 0 3 / 2 3 9 / 2 6
0
15 / 2 9 21 / 2
(6) ( ) exp( 12 / 8) 3 2 3 1 4
5 0 2 4 4
j j j j
x
j j j
F f x j x e e e e e
e e e j
π π π π
π π π
π − − − −
=
− − −
= − = + + + +
+ + + = +
∑5 0 2 4 4e e e j+ + + +
70 7 / 4 7 / 2 21 / 4 7
0
(7) ( ) exp( 14 / 8) 3 2 3 1 4j j j j
x
F f x j x e e e e eπ π π ππ − − − −
=
= − = + + + +∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
25
035 / 4 21 / 2 49 / 45 0 2 2.4142 0.1716
xj j je e e jπ π π− − −+ + + = − +
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
And the Fourier spectra are :
| (0) | 20F = (0) 0φ =| (0) | 20F =2 2 1/ 2| (1) | [( 2.4142) ( 0.1716) ] 2.4203F = − + − =
(0) 0φ =(1) 0.9774φ π= −(2) 0 25φ2 2 1/ 2| (2) | [4 ( 4) ] 5.6569F = + − =
2 2 1/ 2| (3) | [0.4142 5.8284 ] 5.8431F = + =
(2) 0.25φ π= −(3) 0.4774φ π=
| (4) | 0F =2 2 1/ 2| (5) | [0.4142 ( 5.8284) ] 5.8431F = + − =
(4)φ π=(5) 0.4774φ π= −| ( ) | [ ( ) ]
2 2 1/ 2| (6) | [4 4 ] 5.6569F = + =
( )φ(6) 0.25φ π=(7) 0 9774φ
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
26
2 2 1/ 2| (7) | [( 2.4142) 0.1716 ] 2.4203F = − + = (7) 0.9774φ π=
3 2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
Graphic illustration :
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
27
3 2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions:1-D DFT example
Graphic illustration :
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
28
3.2 Fourier Transform and Properties3.2.2 definitions: 2D-DFT
The Two-Dimensional Discrete Fourier Transform and its Inverse
1 12 ( / / )( , ) ( , )
M Nj ux M vy NF u v f x y e π
− −− += ∑ ∑
0,1, 1u M= −L
0 1 1v N= −L0 0
( , ) ( , )x y
F u v f x y e= =∑ ∑ 0,1, 1v N=
1 12 ( / / )
0 0
1( , ) ( , )M N
j ux M vy N
u vf x y F u v e
MNπ
− −+
= =
= ∑ ∑ 0,1, 1x M= −L
0,1, 1y N= −L
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
29
3.2 Fourier Transform and Properties3.2.2 definitions: 2D-DFT
Magnitude or spectrum
[ ] 2122 ),(),(),( vuIvuRvuF +=
Magnitude or spectrum
Phase angle or phase spectrum
[ ]),(),(arctan),( vuRvuIvu =φPhase angle or phase spectrum
),(),(),(),( 222 vuIvuRvuFvuP +==
Power spectrum(Spectral density)
),(),(),(),( vuIvuRvuFvuP +
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
30
3.2 Fourier Transform and Properties3.2.2 definitions: 2D-DFT
Magnitude Phaseimage
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
31
3.2 Fourier Transform and Properties3.2.2 definitions: 2D-DFT
Typical images and their spectra
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
32
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions: 2D-IDFT
IDFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
33
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions: 2D-IDFT
IDFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
34
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.2 definitions: 2D-IDFT
IDFTIDFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
35
3.2 Fourier Transform and Properties3.2.3 Properties: Display
•Usually the Fourier spectra are displayed as intensity functionUsually the Fourier spectra are displayed as intensity function.• many image spectra decrease rather rapidly as a function of increasing frequency
•their high-frequency terms have a tendency to become obscured when displayed in image.
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
36
3.2 Fourier Transform and Properties
• A useful processing technique which compensates for this difficulty consists of displaying the function
3.2.3 Properties: Display
this difficulty consists of displaying the function
1( , ) log(1 ( , ) )D u v F u v= +
Or
2
( , ) 100 ( , )
F u vD u v
⎧ +⎪= ⎨2 ( , )255 if ( , ) 100 255
D u vF u v⎨ + >⎪⎩
•instead of ( , )F u v
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
37
3.2 Fourier Transform and Properties3.2.3 Properties: Display
( , )F u v
2 ( , )D u v
( )D
2 ( , )
1( , )D u v
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
38
3.2 Fourier Transform and Properties3.2.3 Properties: separability
The DFT pair can be expressed in the separable forms:
⎤⎡⎤⎡ −− vyjuxj NN ππ 221 11
The DFT pair can be expressed in the separable forms:
⎥⎦⎤
⎢⎣⎡−
⎥⎦⎤
⎢⎣⎡−= ∑∑
== Nvyjyxf
Nuxj
NvuF
N
y
N
x
ππ 2exp),(2exp1),(1
0
1
0
∑∑−
=
−
=⎥⎦⎤
⎢⎣⎡
⎥⎦⎤
⎢⎣⎡=
1
0
1
0
2exp),(2exp1),(N
v
N
u NvyjvuF
Nuxj
Nyxf ππ
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
39
3.2 Fourier Transform and Properties3.2.3 Properties: separability
The principal of the separability property is that f(x,y) or F(u,v)p p p y p p y f( ,y) ( , )can be obtained in two steps by successive applications of the 1-DFourier transform or its inverse
Y
(N-1)
V
(N-1)
V
(N-1)
f(x,y)
X
( )(0 0)
列变换
乘以NF(x,v)
X
( )(0 0)
行变换F(u,v)
U
( )(0 0)(N-1)(0,0) (N-1)(0,0) (N-1)(0,0)
图3.2.2 由2步1-D变换计算2-D变换
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
40
3.2 Fourier Transform and Properties3.2.3 Properties: separability
For a N*N image, it can be separated into 2N 1D-DFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
41
3.2 Fourier Transform and Properties3.2.3 Properties: periodicity and conjugate symmetryThe discrete Fourier transform and its inverse are periodic with
),(),(),(),( NvNuFNvuFvNuFvuF ++=+=+=Period N
The Fourier transform also exhibits conjugate symmetry since
( ) ( )F u v F u v∗
Or more interestingly,
( , ) ( , )F u v F u v= − −
( , ) ( , )F u v F u v= − −
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
42
|F(u)|1D periodicity and conjugate symmetry
|F(u)|
One period-N/2 N/2 N-1,N0
|F(u)|
-N/2 N/2 N 10Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang43
One periodN/2 N/2 N-10
2D periodicity and conjugate symmetry
(0 0) (0,N-1)
One period
(0,0) (0,N 1)
One period
(N-1,0)( )
(2N-1,2N-1)
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
44
3.2 Fourier Transform and Properties3.2.3 Properties: periodicity and conjugate symmetry
Lowfrequencies
High frequencies
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
45
3.2 Fourier Transform and Properties3.2.3 Properties: translation
The translation properties of the Fourier transform pair are given byp p p g y
[ ] ),()(2exp),( 0000 vvuuFNyvxujyxf −−⇔+π[ ] 0000
and
[ ]NvyuxjvuFyyxxf )(2exp),(),( 0000 +−⇔−− π
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
46
3.2 Fourier Transform and Properties3.2.3 Properties: translation
A hift i f( ) d t ff t th it d f it F iA shift in f(x,y) does not affect the magnitude of its Fourier transform since
[ ]0 0| ( , ) exp 2 ( ) | | ( , ) |F u v j ux vy N F u vπ− + =[ ]0 0| ( ) p ( ) | | ( ) |j y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
47
3.2 Fourier Transform and Properties3.2.3 Properties: translation
Example: in the case u0=v0=N/2, it follows thatExample: in the case u0 v0 N/2, it follows that
and
( )( 1) ( / 2 / 2)x yf +( , )( 1) ( / 2, / 2)x yf x y F u N v N+− ⇔ − −
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
48
3.2 Fourier Transform and Properties3.2.3 Properties: translation
Example of One-Dimensional DFT shiftf(x)
F( )F(u)shift
F(u)No shift
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
49
3.2 Fourier Transform and Properties3.2.3 Properties: translation
Example of Two-Dimensional DFT shift
F( )F(u,v)No shift
F(u,v) shifted
(0,0) (0,N-1)
(N-1,0)
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
50
(2N-1,2N-1)
3.2 Fourier Transform and Properties3.2.3 Properties: translation
Example of Two-Dimensional DFT shift
F(u)F(u)No shift
F(u,v)shifted
f(x,y)
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
51
shifted
3.2 Fourier Transform and Properties3.2.3 Properties: rotation
If we introduce the polar coordinates
cos( )x r θ= sin( )y r θ= cos( )u ω φ= sin( )v ω φ=
Th f( ) d F( )b d i l( )f θ ( )F φThen f(x,y) and F(u,v)become and respectively( , )f r θ ( , )F ω φ
),(),( 00 θφθθ +⇔+ wFrf
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
52
3.2 Fourier Transform and Properties3.2.3 Properties: rotation
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
53
3.2 Fourier Transform and Properties3.2.3 Properties: Distributivity
It follows directly from the definition of the transform pair that,
{ } { } { }),(),(),(),( 2121 yxfFyxfFyxfyxfF +=+
y p
And, in general that,
{ } { } { }),(),(),(),( 2121 yxfyxfFyxfyxfF ⋅≠⋅
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
54
3.2 Fourier Transform and Properties3.2.3 Properties: scaling
It is also easy to show that for two scalar a and b
)()( vuaFyxaf ⇔
It is also easy to show that for two scalar a and b
),(),( vuaFyxaf ⇔and
⎟⎠⎞
⎜⎝⎛⇔
bv
auF
abbyaxf ,1),(
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
55
3.2 Fourier Transform and Properties3.2.3 Properties: average value
A widely-used definition of the average value of a 2DA widely used definition of the average value of a 2DDiscrete function is given by the expression
∑∑− −1 1~ 1 N N
∑∑= =
=0 0
2 ),(1),(x y
yxfN
yxf
b i i f i d fi i i f i ldSubstitution of u-v-0 in definition of 2D DFT yields
− −1 11 N N 1~
∑∑= =
=0 0
),(1)0,0(x y
yxfN
F )0,0(1),( FN
yxf =
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
56
3.2 Fourier Transform and Properties3.2.3 Properties: convolution
The convolution of two functions f(x) and g(x), denoted by
∫∞
f(x)*g(x), is defined by the integral:
dzzxgzfxgxf ∫∞−
−=∗ )()()()(
Where z is a dummy variable of integration
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
57
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.3 Properties: convolutionExample1: graphic illustration of convolution f(x)*g(x)
( ) ( )
Example1: graphic illustration of convolution f(x)*g(x)
f(z)
z
1
g(z)
z1/2
g(-z) g(x-z)
z z1/2 1/2
z
0 1(a)
z
0 1(b) (c) (d)
z z
0-1 -1 x0
( ) ( ) ( ) ( ) ( ) ( )f(z)g(x-z)
z
1/2110 ≤≤ x 121 ≤≤ x
1/2z
f(z)g(x-z)
1/2x
f(x)*g(x)
z
0 x 1-1 0 1x-1 x
z
(f)(e)
0 1 2
x
(g)
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
58
图3.2.3 1-D函数卷积示例
3.2 Fourier Transform and Properties3.2 Fourier Transform and Properties3.2.3 Properties: convolution
Example2: graphic illustration of convolution f(x,y)*g(x,y)
x
ζζ ζ ζM-1A-1
N-1
g(ζ,η)
f(ζ,η)
g(-ζ,-η)
g(x-ζ, y-η)B-1
ηηf(ζ,η)
η ηy
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
59
3.2 Fourier Transform and Properties3.2.3 Properties: convolutionExample2: graphic illustration of convolution f(x,y)*g(x,y)p g p f( ,y) g( ,y)
ζ ζ ζ xA+M-1(0,0)
ζ ζ ζ
η η η B+N-1
f(ζ,η) *g(x-ζ, y-η)f(ζ,η) *g(x-ζ, y-η)
y f(x,y)*g(x,y)
f(ζ,η) *g(x-ζ, y-η)
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
60
3.2 Fourier Transform and Properties3.2.3 Properties: convolution
If f(x y) has the Fourier transform F(u v) and g(x y)has the FourierIf f(x,y) has the Fourier transform F(u,v) and g(x,y)has the FourierTransform G(u,v), then f(x,y)*g(x,y) has the Fourier transformF(u,v)G(u,v).This result, formally stated as:( ) ( ) y
),(),(),(),( vuGvuFyxgyxf ⇔∗
And the convolution in frequency domain reduces to multiplicationIn the spatial-domain
),(),(),(),( vuGvuFyxgyxf ∗⇔
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
61
3.2 Fourier Transform and Properties3.2.3 Properties: convolutionDefinition of 1D-discrete convolutionDefinition of 1D discrete convolution
⎧ )(xf 10 −≤≤ Ax
⎩⎨⎧
=0
)()(
xfxfe
⎧
10 ≤≤ Ax1−≤≤ MxA
⎩⎨⎧
=0
)()(
xgxge
10 −≤≤ Bx
1−≤≤ MxB
∑−
−=∗1
)()(1)()(M
mxgmfxgxf x=0,1,…,Mx=0,1,…,M--11∑=
=∗0
)()()()(m
eeee mxgmfM
xgxf x 0,1,…,Mx 0,1,…,M 11
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
62
3.2 Fourier Transform and Properties3.2.3 Properties: convolutionDefinition of 2D-discrete convolutionDefinition of 2D discrete convolution
⎨⎧ ),(
)(yxf
yxf10 −≤≤ Ax andand 10 −≤≤ By
⎩⎨= 0
),( yxfe1−≤≤ MxA oror 1−≤≤ NyB
⎩⎨⎧
=0
),(),(
yxgyxge
andand
oror
0 1x C≤ ≤ −
1−≤≤ MxC
10 −≤≤ Dy
1−≤≤ NyD y
1,...,1,0 −= Mx∑∑− −
−−=∗1 1
),(),(1),(),(M N
nymxgnmfyxgyxf ∑∑= =0 0
),(),(),(),(m n
eeee nymxgnmfMN
yxgyxf1,...,1,0 −= Ny
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
63
question
DFT ??
2003 Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
64
The answer is:
Amplitude Phasep Phase
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
65
The answer is:
Amplitude Phasep Phase
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
66
3.3 Other Separable Transforms3.3.1 General formulations
Definition1: if X is an N-by-1 vector and T is an N-by-N matrix then:1
,0
N
i i j jj
y t x−
=
=∑ polynomial expression
0 0,0 0,1 0, 1 0Ny t t t x−⎡ ⎤ ⎡ ⎤ ⎡ ⎤⎢ ⎥ ⎢ ⎥ ⎢ ⎥
L
Y TX=1 1,0 1,1 1, 1 1Ny t t t x−⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥=⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥
L
M O MM
1,0 1,1 1, 1 11 N N N N NNt t t xy − − − − −−
⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥ ⎣ ⎦⎣ ⎦⎣ ⎦ L
matrix expressionDigital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang67
matrix expression
3.3 Other Separable Transforms
1X T Y
3.3.1 General formulations
Definition2: inversion 1X T Y−=Definition2: inversion
If k(T) N h i i li f1 tT T− ∗= 1tTT TT I∗ −= =
If rank(T)= N then it is a linear transform
If then it is a Unitary transform
1 tT T− =If then it is a orthogonal transform 1tTT TT I−= =
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
68
3.3 Other Separable Transforms3.3.1 General formulations
Example: 1-D Discrete Fourier Transform (DFT)Example: 1 D Discrete Fourier Transform (DFT)
21
( ) ( )N j ux
NF u f x eπ− −
=∑ F Tf=0
( ) ( )x
F u f x e=
=∑211( ) ( )
N j uxNf Fπ−
∑
F Tf=
1f T F−
0
( ) ( ) N
u
f x F u eN =
= ∑ 1f T F=
1 tT T− ∗
It is a Unitary transform
T T=
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
69
3.3 Other Separable Transforms
Definition3: 2 D transformation
3.3.1 General formulations
1 1
( )M N− −
Φ∑∑
Definition3: 2-D transformation
, ,0 0
( , , , )m n i ji j
y x i j m n= =
= Φ∑∑
Can be thought of as a MN-by-MN block matrix haveM rows of M blocks, each of which is an N-by-N
( , , , )i j m nΦ
matrix
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
70
3.3 Other Separable Transforms3.3.1 General formulations
Definition4: if can be separated into the product ( , , , )i j m nΦ p pof rowwise and columnwise component function, that is
( , , , )j
( , , , ) ( , ) ( , )r ci j m n T i m T j nΦ =
then the transformation is called separablethen the transformation is called separable
[ ]1 1
( , ) ( , )M N
m n i j c ry x T j n T i m− −
= ∑ ∑[ ], ,0 0
( , ) ( , )m n i j c ri j
y x j n i m= =∑ ∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
71
3.3 Other Separable Transforms3.3.1 General formulations
Definition5: if two component are identical:p
( , , , ) ( , ) ( , )i j m n T i m T j nΦ =
then the transformation is called symmetric1 1M N
[ ]1 1
, ,0 0
( , ) ( , )M N
m n i ji j
y x T j n T i m− −
= =
= ∑ ∑oror
Y TXT=
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
72
3.3 Other Separable Transforms3.3 Other Separable Transforms3.3.1 General formulations
Example: 2-D Discrete Fourier Transform (DFT)
Separable and Symmetric Unitary transform
⎥⎦⎤
⎢⎣⎡−
⎥⎦⎤
⎢⎣⎡−= ∑∑
−
=
−
= Nvyjyxf
Nuxj
NvuF
N
y
N
x
ππ 2exp),(2exp1),(1
0
1
0
lets exp( 2 / )MW j Mπ=
exp( 2 / )NW j Nπ=
then
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
73
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)3.3. sc e e Cos e s o ( C )
The 1-D DCT pair is given by the expression:1
0
(2 1)( ) ( ) ( ) cos2
N
x
x uC u a u f xN
π−
=
+⎡ ⎤= ⎢ ⎥⎣ ⎦∑ x=0,1,…N-1
1
0
(2 1)( ) ( ) ( ) cos2
N
u
x uf x a u C uN
π−
=
+⎡ ⎤= ⎢ ⎥⎣ ⎦∑
u=0,1,…N-10 2u N= ⎣ ⎦
where
⎧ 1 0( )
2 1,2, , 1
N ua u
N u N
⎧ =⎪= ⎨= −⎪⎩ L
when
when
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
74
, , ,⎪⎩
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)3.3. sc e e Cos e s o ( C )
Basis function matrix
1/ 2 1/ 2 1/ 2⎡ ⎤⎢
L⎥
x
ucos / 2 cos3 / 2 cos(2 1) / 2cos 2 / 2 cos 6 / 2 cos 2(2 1) / 2
23 / 2 9 / 2 3(2 1) / 2
N N N NN N N N
C N N N N
π π ππ π π
⎢−⎢
⎢ −⎢
= ⎢
L
L
⎥⎥⎥⎥⎥
u
cos3 / 2 cos9 / 2 cos3(2 1) / 2cos 4 / 2 cos12 / 2 cos 4(2 1) / 2
NC N N N NN
N N N Nπ π ππ π π
= −⎢⎢ −⎢⎢
L
L
M M O M
⎥⎥⎥⎥
cos( 1) / 2 cos3( 1) / 2 cos(2 1)( 1) / 2N N N N N N Nπ π π⎢⎢ − − − −⎢⎣ ⎦
M M O M
L
⎥⎥⎥
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
75
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)3.3. sc e e Cos e s o ( C )
The 1 DCT basis function for N=8Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang76
The 1-DCT basis function for N=8
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)3.3. sc e e Cos e s o ( C )
DCT 1D N=64Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang77
DCT_1D N 64
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)3.3. sc e e Cos e s o ( C )
The 2-D DCT pair is given by the expression:
1 1 (2 1) (2 1)( , ) ( ) ( ) ( , ) cos cosN N x u y vC u v a u a v f x y π π− − + +⎡ ⎤ ⎡ ⎤= ⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦∑∑
0 0( , ) ( ) ( ) ( , ) cos cos
2 2x yC u v a u a v f x y
N N= =⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦
∑∑
u,v=0,1,…N-11 1
0 0
(2 1) (2 1)( , ) ( ) ( ) ( , ) cos cos2 2
N N
u v
x u y vf x y a u a v C u vN N
π π− −
= =
+ +⎡ ⎤ ⎡ ⎤= ⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦∑∑
x,y=0,1,…N-1
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
78
3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)
u
v
x
y
The 2D-DCT basis images for N=4
y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
79
The 2D DCT basis images for N 4
3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)
A l f 2D DCTAn example of 2D-DCT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
80
3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)Relationship between DFT and DCTp
DCTDCT
DFTDFT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
81
3.3 Other Separable Transforms3.3.2 Discrete Cosine Transform (DCT)Relationship between DFT and DCTp
Shifted DFT
DFTDCT
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
82
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform3.3. W s s o
1 1n−
When N=2n, the kernel function is:1( , )g x uN
= 1( ) ( )
0
( 1) i n ib x b u
i
− −
=
−∏
1
11( ) ( )1( ) ( ) ( 1) i i
nNb x b uW f
−−
∑ ∏
the discrete Walsh transform of a function f(x), denote by W(u), is:
1( ) ( )
0 0
( ) ( ) ( 1) i n ib x b u
x i
W u f xN
− −
= =
= −∑ ∏
Wh b ( ) i h k h bi i h bi i fWhere bk(z) is the kth bit in the binary representation of z.Eg: n=3, z=6 (110 in binary), we have that
b (z)=0 b (z)=1 and b (z)=1Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang83
b0(z) 0, b1 (z) 1, and b2(z) 1
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 1-D transform3.3.2 Walsh transform: 1 D transformThe values of g(x,u) are list in below
u\x 0 1 2 3 4 5 6 7x
0 + + + + + + + +
1 + + + +
u
1 + + + + - - - -
2 + + - - + + - -
3 + + - - - - + +
4 + - + - + - + -
5 + - + - - + - +
6 + - - + + - - +
7 + - - + - + + -
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
84
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 1-D transform3.3.2 Walsh transform: 1 D transform
Inverse kernel and transform:
1
1( ) ( )( , ) ( 1) i n i
nb x b uh x u − −
−
= −∏0i=∏
11 nN −−1( ) ( )
0 0
( ) ( ) ( 1) i n ib x b u
u i
f x W u − −
= =
= −∑ ∏
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
85
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 1-D matrix expression N=83.3.2 Walsh transform: 1 D matrix expression N 8
0 0
1 1
1 1 1 1 1 1 1 11 1 1 1 1 1 1 1
w fw f⎡ ⎤ ⎡ ⎤⎡ ⎤⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥
2 2
3 3
4 4
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1
w fw fw f
⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥=⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥
5 5
6 6
77
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1
w fw f
fw
⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ ⎥ ⎢⎢ ⎥− − − −⎢ ⎥ ⎢⎢ ⎥
− − − −⎢ ⎥⎢ ⎥ ⎢⎣ ⎦ ⎣ ⎦⎣ ⎦
⎥⎥⎥77 f⎢ ⎥⎢ ⎥ ⎢⎣ ⎦ ⎣ ⎦⎣ ⎦ ⎥
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
86
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 1-D transform3.3.2 Walsh transform: 1 D transform The values of g(x,u) are list in below for N=8
u\x 0 1 2 3 4 5 6 7 Sequency of the x
0 + + + + + + + +
1 + + + +
01
rowu
1 + + + + - - - -
2 + + - - + + - -
3 + + - - - - + +
132
4 + - + - + - + -
5 + - + - - + - +
76
6 + - - + + - - +
7 + - - + - + + -
45
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
87
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 1-D ordered Walsh transform3.3.2 Walsh transform: 1 D ordered Walsh transform The values of g(x,u) are list in below for N=8
u\x 0 1 2 3 4 5 6 7 Sequency of the x
0 + + + + + + + +
1 + + + +
01
rowu
1 + + + + - - - -
2 + + - - - - + +
3 + + - - + + - -
123
4 + - - + + - _ +
5 + - - + - + + -
45
6 + - + - - + - +
7 + - + - - + + -
67
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
88
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 2-D transform3.3.2 Walsh transform: 2 D transform The direct and inverse kernel functions are expressed as:
1 1
1[ ( ) ( ) ( ) ( )]1( ) ( 1) i n i i n i
nb x b u b y b vg x y u v − − − −
−+= −∏
0
( , , , ) ( 1)i
g x y u vN =
= ∏1 1
1[ ( ) ( ) ( ) ( )]
0
1( , , , ) ( 1) i n i i n i
nb x b u b y b v
i
h x y u vN
− − − −
−+
=
= −∏0i=
And the direct and inverse transforms are:
1 1
11 1[ ( ) ( ) ( ) ( )]
0 0 0
1( , ) ( , ) ( 1) i n i i n i
nN Nb x b u b y b v
x y i
W u v f x yN
− − − −
−− −+
= = =
= −∑∑ ∏11 11 nN N −− −
∑∑ 1 1[ ( ) ( ) ( ) ( )]
0 0 0
1( , ) ( , ) ( 1) i n i i n ib x b u b y b v
u v i
f x y W u vN
− − − −+
= = =
= −∑∑ ∏
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
89
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 2-D transform3.3.2 Walsh transform: 2 D transform
The direct and inverse kernel functions areSeparable and SymmetricSeparable and Symmetric
1 1 1 1( , , , ) ( , ) ( , ) ( , ) ( , )g x y u v g x u g y v h x u h y v= =
So it can be implemented in two steps
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
90
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Walsh transform: 2-D transform3.3.2 Walsh transform: 2 D transform
u
vv
x
The Walsh transform basis images for N=4y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
91
g
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Hadamard transform: 1-D transform 3.3. d d s o : s oWhen N=2n, the kernel function is:
1n−
0
( ) ( )1( , ) ( 1)i i
i
b x b u
g x uN
=∑
= −
1 D Hadamard transform of a function f(x) denote by H(u) is:
Where the summation in the exponent is performed in modulo 2
1-D Hadamard transform of a function f(x), denote by H(u), is:
11 ( ) ( )1
n
i iN b x b u−
− ∑0
( ) ( )
0
1( ) ( )( 1)i i
i
x
H u f xN
=
=
∑= −∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
92
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Hadamard transform: 1-D inverse transform 3.3. d d s o : ve se s o
Inverse kernel and transform:1
0
( ) ( )
( , ) ( 1)
n
i ii
b x b u
h x u
−
=∑
= −
1
0
1 ( ) ( )
( ) ( )( 1)
n
i ii
N b x b u
f x H u
−
=
− ∑= −∑
0
( ) ( )( 1)u
f x H u=
= −∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
93
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 hadamard transform: 1-D matrix expression N=8
1 1 1 1 1 1 1 1h f⎡ ⎤ ⎡ ⎤⎡ ⎤
3.3.4 hadamard transform: 1 D matrix expression N 8
0 0
1 1
2 2
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1
h fh fh fh f
⎡ ⎤ ⎡ ⎤⎡ ⎤⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥3 3
4 4
5 5
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1
h fh fh fh
⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥=⎢ ⎥ ⎢ ⎥⎢ ⎥− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥
− − − −⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢⎢ ⎥ ⎥
6 6
77
1 1 1 1 1 1 1 11 1 1 1 1 1 1 1
h ffh
⎢ ⎥ ⎢⎢ ⎥− − − −⎢ ⎥ ⎢⎢ ⎥
− − − −⎢ ⎥⎢ ⎥ ⎢⎣ ⎦ ⎣ ⎦⎣ ⎦
⎥⎥⎥
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
94
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Hadamard transform: 1-D transform3.3.2 Hadamard transform: 1 D transform The values of g(x,u) are list in below for N=8
u\x 0 1 2 3 4 5 6 7 Sequency of the x
0 + + + + + + + +
1 + + + +
07
rowu
1 + - + - + - + -
2 + + - - + + - -
3 + - - + + - - +
734
4 + + + + - - _ -
5 + - + - - + - +
16
6 + + - - - - + +
7 + - - + - + + -
25
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
95
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.2 Hadamard transform: 1-D transform3.3.2 Hadamard transform: 1 D transform
The 1 D Hadamard transform basis function for N=8Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang96
The 1-D Hadamard transform basis function for N=8
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 Hadamard transform: 1-D transform3.3.4 Hadamard transform: 1 D transform
h b h k l i iAnother way for generating kernel matrix
2
1 111 12
H⎡ ⎤
= ⎢ ⎥⎣ ⎦
For the two-by-two case, the kernel matrix is
1 12 −⎣ ⎦
And for successively larger N, these can be generated fromThe block matrix from
N NH HH H H
⎡ ⎤= = ⊗⎢ ⎥
The block matrix from
2 2N NN N
H H HH H
= = ⊗⎢ ⎥−⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
97
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 Hadamard transform: 1-D transform3.3.4 Hadamard transform: 1 D transform
Another way for generating kernel matrix
For examples1 1 1 1 1 1 1 11 1 1 1 1 1 1 1⎡ ⎤⎢ ⎥
4
1 1 1 11 1 1 111 1 1 14
H
⎡ ⎤⎢ ⎥− −⎢ ⎥=⎢ ⎥− − 8
1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 11H
⎢ ⎥− − − −⎢ ⎥⎢ ⎥− − − −⎢ ⎥− − − −⎢ ⎥= ⎢ ⎥1 1 1 14
1 1 1 1⎢ ⎥⎢ ⎥− −⎣ ⎦
8 1 1 1 1 1 1 1 181 1 1 1 1 1 1 11 1 1 1 1 1 1 1
H ⎢ ⎥− − − −⎢ ⎥
− − − −⎢ ⎥⎢ ⎥− − − −⎢ ⎥1 1 1 1 1 1 1 1⎢ ⎥
− − − −⎢ ⎥⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
98
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 Hadamard transform: 1-D ordered Hadamard transform3.3.4 Hadamard transform: 1 D ordered Hadamard transform
Lets kernel function:1
( ) ( )
01( ) ( 1)
nb x p ui i
ig x u
−
=∑
= 0( , ) ( 1) ig x uN
= −
0 1( ) ( )np u b u−= ⎫⎪where
1 1 2( ) ( ) ( )n np u b u b u− −⎪= + ⎪⎬⎪⎪
M
where
1 1 0( ) ( ) ( )np u b u b u−⎪= + ⎭
And inverse kernel function:1
( ) ( )
0( , ) ( 1)
nb x p ui i
ih x u
−
=∑
= −
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
99
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 Hadamard transform: 1-D ordered Hadamard transform3.3.4 Hadamard transform: 1 D ordered Hadamard transform The values of g(x,u) are list in below for N=8
u\x 0 1 2 3 4 5 6 7 Sequency of the S ith th
0 + + + + + + + +
1 + + + +
01
rowSame with theOrdered
Walsh transform
1 + + + + - - - -
2 + + - - - - + +
3 + + - - + + - -
123
4 + - - + + - _ +
5 + - - + - + + -
45
6 + - + - - + - +
7 + - + - - + + -
67
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
100
3 3 Oth S bl T f3.3 Other Separable Transforms3.3.4 Hadamard transform: 1-D ordered Hadamard transform3.3.4 Hadamard transform: 1 D ordered Hadamard transform
Then the ordered Hadamard transform pair is
1( ) ( )
0
11( ) ( )( 1)
nb x p ui i
i
N
H u f x
−
=
− ∑= −∑
0( ) ( )( 1)
xH u f x
N =∑
1( ) ( )
nb
−
∑ ( ) ( )
0
1
( ) ( )( 1)b x p ui i
i
N
f x H u =
− ∑= −∑
0u=
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
101
3.3 Other Separable Transformsp3.3.4 Hadamard transform: 2-D transform
The kernel functions of 2-D Hadamard are:1
[ ( ) ( ) ( ) ( )]
01( , , , ) ( 1)
nb x b u b y b vi i i i
ih x y u vN
−+
=∑
= −1
[ ( ) ( ) ( ) ( )]
01( , , , ) ( 1)
nb x b u b y b vi i i i
ig x y u vN
−+
=∑
= −
N
NBoth the direct and inverse kernel function are Separable and Symmetric because
1 1 1 1( , , , ) ( , ) ( , ) ( , ) ( , )g x y u v g x u g y v h x u h y v= =
Separable and Symmetric, because
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
102
3.3 Other Separable Transformsp3.3.4 Hadamard transform: 2-D transform
And the 2-D Hadamard transform is defined as:
1[ ( ) ( ) ( ) ( )]
0
1 11( , ) ( , )( 1)
nb x b u b y b vi i i i
i
N N
H u v f x yN
−+
=
− − ∑= −∑∑
0 0x yN = =
1[ ( ) ( ) ( ) ( )]1 11
nb x b u b y b vi i i iN N
−+− − ∑
0
1 1
0 0
1( , ) ( , )( 1) i
N N
x yf x y H u v
N=
= =
∑= −∑∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
103
3.3 Other Separable Transformsp3.3.2 Hadamard transform: 2-D transform
uu
v
x
The Hadamard transform basis images for N=4
y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
104
The Hadamard transform basis images for N=4
3.3 Other Separable Transformsp3.3.4 Hadamard transform: 2-D ordered transform
The direct and inverse kernel functions of 2-D ordered Hadamard are same as: 1 [ ( ) ( ) ( ) ( )]
1n b x p u b y p vi i i i− +∑
A d h 2 D d d H d d f i d fi d
01( , , , ) ( , , , ) ( 1) ig x y u v h x y u vN
=∑
= = −
And the 2-D ordered Hadamard transform is defined as:1 [ ( ) ( ) ( ) ( )]
1 11n b x p u b y p vi i i iN N− +
− − ∑∑∑ 0
0 0
1( , ) ( , )( 1) i
x y
H u v f x yN
=
= =
∑= −∑∑
1 [ ( ) ( ) ( ) ( )]n b x p u b y p vi i i i− +[ ( ) ( ) ( ) ( )]
0
1 1
0 0
1( , ) ( , )( 1)b x p u b y p vi i i i
i
N N
x y
f x y H u vN
+
=
− −
= =
∑= −∑∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
105
0 0x y
3.3 Other Separable Transformsp3.3.4 Hadamard transform: 2-D ordered transform
uu
v
x
Basis image of 2-D ordered Hadamard transform y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
106
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions1 Haar function1. Haar function
The Haar functions hk(z) are defined on the interval [0,1], and k=0 1 N-1 N=2n Let theInteger be specified0 1k N≤ ≤ −k 0,1…N 1, N 2 . Let theInteger be specified ( uniquely) by two other integers, p and q, as
0 1k N≤ ≤ −
2 1pk q= + −2 1k q+
Where 2p is the largest power of 2 such that and q-1 is Th i d
2 p k≤The remainder
For example, k=1=20+1-1, p=0, q=1k , p 0, qk=23=24+8-1, p=4, q=8k=100=26+37-1, p=6, q=37
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
107
, p , q
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions1 Haar function1. Haar function
The Haar functions are defined by
0 00( ) ( ) 1h z h z N= = [0,1]z∈
1 2122 2
2 p pqqp z −−⎧ ≤ <
⎪ 2 21 22
2 2
1( ) ( ) 2
0p p
q qpk pqh z h z z
N−
⎪⎪= = − ≤ <⎨⎪⎪⎩ others0⎪⎩ others
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
108
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions2 Haar transform matrix2. Haar transform matrix
0 0 0(0 / ) (1/ ) ( 1/ )h N h N h N N−⎡ ⎤L0 0 0
1 1 1
(0 / ) (1/ ) ( 1/ )(0 / ) (1/ ) ( 1/ )
h N h N h N Nh N h N h N N
H
⎡ ⎤⎢ ⎥−⎢ ⎥=⎢ ⎥⎢ ⎥
L
M M O M
1 1 1(0 / ) (1/ ) ( 1/ )N N Nh N h N h N N− − −
⎢ ⎥⎢ ⎥−⎢ ⎥⎣ ⎦K
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
109
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions2 Haar transform matrix2. Haar transform matrix
For example: N=20 00
1(0 / 2) (0 / 2)h h= =
0 02
1 1
(0 2) (1 2)(0 2) (1 2)
h hH
h h⎡ ⎤
= ⎢ ⎥⎣ ⎦
0 00(0 / 2) (0 / 2)2
h h
0 001(1/ 2) (1/ 2)2
h h= =1 1(0 2) (1 2)h h⎣ ⎦ 2
11 01
1(0 / 2) (0 / 2)2
h h= =k=0 p=0, q=0
1 011(1/ 2) (1/ 2)2
h h= = −k=1 p=0, q=1
2
1 111 12
H⎡ ⎤
= ⎢ ⎥−⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
110
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions2 Haar transform matrix2. Haar transform matrix
For example: N=4 For example: N=8p1 1 1 11 1 1 11H
⎡ ⎤⎢ ⎥− −⎢ ⎥
⎡ ⎤4 2 2 0 02
0 0 2 2
H ⎢ ⎥= ⎢ ⎥−⎢ ⎥⎢ ⎥−⎣ ⎦
1 1 1 1 1 1 1 11 1 1 1 1 1 1 1
2 2 2 2 0 0 0 0
⎡ ⎤⎢ ⎥− − − −⎢ ⎥⎢ ⎥− −⎢ ⎥
8
2 2 2 2 0 0 0 01 0 0 0 0 2 2 2 28 2 2 0 0 0 0 0 0
H⎢ ⎥⎢ ⎥− −= ⎢ ⎥−⎢ ⎥⎢ ⎥0 0 2 2 0 0 0 0
0 0 0 0 2 2 0 00 0 0 0 0 0 2 2
⎢ ⎥−⎢ ⎥
−⎢ ⎥⎢ ⎥−⎢ ⎥⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
111
0 0 0 0 0 0 2 2⎢ ⎥⎣ ⎦
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions2. Haar transform matrix. s o
h f b i f i fDigital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang112
The 1-D Haar transform basis function for N=8
3.3 Other Separable Transformsp3.3.5 Haar transform: definitions3 Haar transform3. Haar transform
G HF=Direct transform:f
0 01 1 1 1 1 1 1 1g f⎡ ⎤⎡ ⎤ ⎡ ⎤
⎢ ⎥⎢ ⎥ ⎢ ⎥
1F H G−=Inverse transform:
1 1
2 2
1 1 1 1 1 1 1 1
2 2 2 2 0 0 0 01 0 0 0 0 2 2 2 2
g fg fg f
⎢ ⎥⎢ ⎥ ⎢ ⎥− − − −⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥− −⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥3 3
4 4
5 5
1 0 0 0 0 2 2 2 28 2 2 0 0 0 0 0 0
0 0 2 2 0 0 0 0
g fg fg f
⎢ ⎥− −⎢ ⎥ ⎢ ⎥= ⎢ ⎥⎢ ⎥ ⎢ ⎥−⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥−⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥
6 6
7 7
0 0 0 0 2 2 0 00 0 0 0 0 0 2 2
g fg f
⎢ ⎥⎢ ⎥ ⎢ ⎥−⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥⎢ ⎥ ⎢ ⎥−⎣ ⎦ ⎣ ⎦⎢ ⎥⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
113
3.3 Other Separable Transformsp3.3.5 Haar transform: properties3 Haar transform3. Haar transform
u
v
x
h f b i i f
y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
114The Haar transform basis images for N=4
3.3 Other Separable Transformsp3.3.5 Haar transform: mallat algorithms
h(-n) 2 2 h(n)
+
jka
1jka +
j
g(-n) 2 2 g(n)
+
1jkd +
jka
LL1
LH1
HL1
HH1
HL2
HL3
LH2
HH2
LH3 HH3
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
115
3.3 Other Separable Transformsp3.3.5 Haar transform: mallat algorithms
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
116
3.3 Other Separable Transformsp3.3.6 Slant transform: definitions
2
1 111 12
S⎡ ⎤
= ⎢ ⎥−⎣ ⎦Unitary kernel matrix starting with:
1 0 1 0⎡ ⎤⎢ ⎥⎡ ⎤
M
M
And iterating it according to the schema:
/ 2
1 0 1 00 0
0N N N N Na b a b S
⎢ ⎥⎡ ⎤ ⎢ ⎥⎢ ⎥− ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥
MM M M
M
L L L L L L L M
( / 2) 2 ( / 2) 20 012 0 1 0 1
0 0
N N
N
I IS
− −⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥= ⎢ ⎥⎢ ⎥ ⎢ ⎥−⎢ ⎥ ⎢ ⎥⎢ ⎥
M M M M
L L L L L L L L L L
MM M M
/ 2
( / 2) 2 ( / 2) 2
0 0
00 0
N N N N
N
N N
b a b aS
I I− −
⎢ ⎥⎢ ⎥− ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥⎢ ⎥− ⎢ ⎥⎢ ⎥⎣ ⎦⎢ ⎥
M M MM
L L L L L L L M
M M M M
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
117
( / 2) 2 ( / 2) 2N N⎢ ⎥⎣ ⎦⎢ ⎥⎢ ⎥⎣ ⎦M
3.3 Other Separable Transformsp3.3.6 Slant transform: definitions
Where I is the identity matrix of order N/2-2 and
1 22
2
34( 1)N
NaN
⎡ ⎤= ⎢ ⎥−⎣ ⎦
1 22
2
44( 1)N
NbN
⎡ ⎤−= ⎢ ⎥−⎣ ⎦
For example: N=4⎡ ⎤
4
1 1 1 1
3/ 5 1/ 5 1/ 5 3/ 51S
⎡ ⎤⎢ ⎥
− −⎢ ⎥= ⎢ ⎥4 1 1 1 141/ 5 3/ 5 3/ 5 1/ 5
⎢ ⎥− − −⎢ ⎥⎢ ⎥− −⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
118
3.3 Other Separable Transformsp3.3.6 Slant transform: definitions
For example: N=8
1 1 1 1 1 1 1 1⎡ ⎤1 1 1 1 1 1 1 1
7 / 21 5 / 21 3/ 21 1/ 21 1/ 21 3/ 21 5 / 21 7 / 211 1 1 1 1 1 1 1
− − − −− − − −
⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥
8
1/ 5 3/ 5 3/ 5 1/ 5 1/ 5 3/ 5 3/ 5 1/ 518 3/ 5 1/ 5 1/ 5 3/ 5 3/ 5 1/ 5 1/ 5 3/ 5
7 / 105 1/ 105 9 / 105 17 / 105 17 / 105 9 / 105 1/ 105 7 / 105
S− − − −
=− − − −
⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥7 / 105 1/ 105 9 / 105 17 / 105 17 / 105 9 / 105 1/ 105 7 / 105
1 1 1 1 1 1 1 1
1/ 5 3/ 5 3/ 5 1/ 5 1/ 5 3/ 5 3/ 5
− − − −− − − −
− − − − 1/ 5
⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
119
3.3 Other Separable Transformsp3.3.6 Slant transform: 1-D basis functions
The 1-D Slant transform basis functions for N=8Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang120
The 1 D Slant transform basis functions for N 8
3.3 Other Separable Transformsp3.3.6 Slant transform: 2-D basis images
u
v
x
y
The 2-D Slant transform basis functions for N=4
y
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
121
3.4 Hotelling Transformsg3.3.7 Hotelling transform: definitions
KLT: Karhunen-Loeve Transfrom
Th kth i i i t b d t
KLT: Karhunen Loeve TransfromPCA:Principal Components Analysis
L
The kth image in a image set can be expressed as a vector:
k=0,1, …M-10 1 1 TN
k k k kx x x x −⎡ ⎤= ⎣ ⎦L
T
The covariance matrix of the x vector is defined as
{ }
{( )( ) }Tx x xC E x m x m= − −
where{ }xm E x=
w e e
is the mean vector, E is the expected valueDigital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang122
, p
3.4 Hotelling Transforms3.3.7 Hotelling transform: definitions
g
11 M −
∑
They can be approximated from the samples by using the relations
0x k
k
m xM =
= ∑
and
11 ( )( )M
Ti iC x m x m
−
= − −∑
and
0
1
( )( )
1
x i x i xk
MT T
k k x x
C x m x mM
x x m mM
=
−
= −
∑
∑0kM =∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
123
3.4 Hotelling Transforms3.3.7 Hotelling transform: definitions
l Calculated N eigenvalues and
g
let Calculated N eigenvalues andarranged as 0 1 1Nλ λ λ −≥ ≥ ≥L
l [ ]
0xC Iλ− =
C l l d ilet [ ] 0x i iC I Tλ− = Calculated N eigenvectors Ti and arranged as
⎡ ⎤0
1
T
T
TT
A
⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥M
1T
NT −
⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦
M
Hotelling transform ( )xY A X m= −
Inverse Hotelling transform TX A Y m+Digital Image Processing
Prof.zhengkai Liu Dr.Rong Zhang124
Inverse Hotelling transform xX A Y m= +
3.4 Hotelling Transforms3.3.7 Hotelling transform: properties
Relationship between the eigenvaluse and eigenvectors:
g
x i i iC T Tλ=
Relationship between the eigenvaluse and eigenvectors:
[ ] 0x i iC I Tλ− =
0
1
T
T
TT
⎡ ⎤⎢ ⎥⎢ ⎥ T T
xC A A= ∧
0 0λ⎡ ⎤⎢ ⎥
1
1T
N
TA
T −
⎢ ⎥=⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦
M
1λ⎢ ⎥⎢ ⎥∧ =⎢ ⎥⎢ ⎥
Owhere
10 Nλ −
⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
125
3.4 Hotelling Transforms3.3.7 Hotelling transform: properties
g
{ } { } { }( )y x xm E y E Ax Am AE x Am= = − = −mean vector of y
0m =
The covariance matrix of the Y vector is given by
0ym =
{ }{( )( ) }
( )( )
Ty y y
T
C E Y m Y m
E AX A AX A
= − −
{ }{ }( )( )
( )( )
Tx x
T T
E AX Am AX Am
E A X m X m A
= − −
= − −{ }{ }( )( )
( )( )
x x
T Tx x
E A X m X m A
AE X m X m A= − −
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
126
3.4 Hotelling Transforms3.3.7 Hotelling transform: properties
TC AC A
g
Ty x
T
C AC A
AA
=
= ∧TAA I=
C is a diagonal matrix with elements equal to
AA ∧= ∧
0λ⎡ ⎤
Cy is a diagonal matrix with elements equal to the eigenvalues of Cx, that is
1
2
0
yC
λλ
⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥⎢ ⎥
O
0 Nλ⎢ ⎥⎢ ⎥⎣ ⎦
That’s means elements of Y are uncorrelated
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
127
3.4 Hotelling Transforms3.3.7 Hotelling transform: inverse transform
Si H t lli t f i th l
g
TxX A Y m= +
Since Hotelling transform is orthogonal , so
1 TA A− = and xmIf we form A from K eigenvectors corresponding to the largest eigenvalues as A the recovered vector will be
ˆ TK xX A Y m= +
largest eigenvalues as AK, the recovered vector will be
K xIt can be shown that the mean square error, ems, between Xand is given by the expressionX̂
1 1 1
0 0
N k N
ms j j jj j j K
e λ λ λ− − −
= = =
= − =∑ ∑ ∑
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
128
3.4 Hotelling Transforms3.3.7 Hotelling transform: example
Gi h l f 2 di i h b l
g
Given the samples of 2-dimension vectors shown as below, calculate its Hotelling transform. N=2, M=27
(1,1) (1,2) (2,1) (2,2) (2,3)(3,1) (3,2) (3,3) (4,2) (4,3) (4 4) (4 5) (4 6) (5 3) (5 4)
x1
(4,4) (4,5) (4,6) (5,3) (5,4) (5,5) (5,6) (5,7) (6,4) (6,5) (6 6) (6 7) (6 8) (7 5) (7 6)(6,6) (6,7) (6.8) (7,5) (7,6) (7,7) (7,8)
0 1 2 3 4 5 6 7
x0
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
129
3.4 Hotelling Transforms3.3.7 Hotelling transform: example
g
Let 0 1
Tk k kx x x⎡ ⎤= ⎣ ⎦ k=0,1, …26
251 [ ]25
0
1 4.444 4.296327x k
km x
=
= =∑
251 ( )( )TC ∑0
1 ( )( )27
3 4103 3 2479
Tx i x i x
k
C x m x m=
= − −
⎡ ⎤
∑3.4103 3.2479
3.2479 4.7550⎡ ⎤
= ⎢ ⎥⎣ ⎦
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
130
3.4 Hotelling Transforms3.3.7 Hotelling transform: example
l 3 4103 3 2479λ
g
let 0xC Iλ− = 3.4103 3.24790
3.2479 4.7550λ
λ−
=−
0 7.3993λ = 1 0.7659λ =
[ ] 0C I Tλ ⎡ ⎤ ⎡ ⎤let [ ] 0x i iC I Tλ− =0
0.63140.7755
T ⎡ ⎤= ⎢ ⎥⎣ ⎦
1
0.77550.6314
T−⎡ ⎤
= ⎢ ⎥⎣ ⎦
0.6314 0.77550.7755 0.6314
A⎡ ⎤
= ⎢ ⎥−⎣ ⎦
( )xy A x m= −
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
131
3.4 Hotelling Transforms3.3.7 Hotelling transform: example
g
y =( -4.7309 0.5899) ( -3.9555 1.2212) ( -4.0996 -0.1856) ( -3.3241 0.4458)
( -2.5486 1.0771) ( -3.4682 -0.9611) ( -2.6927 -0.3297) ( -1.9172 0.3017)
( -2.0613 -1.1052) ( -1.2859 -0.4738) ( -0.5104 0.1576) ( 0.2651 0.7890)
my = 1.0e-015 *
-0.6908 -0.1069
( 1.0406 1.4203) ( -0.6545 -1.2493) ( 0.1210 -0.6179) ( 0.8965 0.0135)
( 1.6719 0.6449) ( 2.4474 1.2762) ( 0.7524 -1.3934) ( 1.5279 -0.7620
( 2.3033 -0.1306) ( 3.0788 0.5008) ( 3.8543 1.1322) ( 2.1592 -1.5375)
( 2 9347 0 9061) ( 3 7102 0 2747) ( 4 4857 0 3567)
cy =
7.3993 0.0000
0.0000 0.7659( 2.9347 -0.9061) ( 3.7102 -0.2747) ( 4.4857 0.3567)
corry =x1 y1y0
1.0000 0.0000
0.0000 1.0000
y1
0 1 2 3 4 5 6 7 x0
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
132
x0
3.4 Hotelling Transforms3.3.7 Hotelling transform: example
2
g
x2 y2
x1y1
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
133
3.4 Hotelling Transforms3.3.7 Hotelling transform: inverse transform
g
x2 y2y
x1 1KLT
x1 y1
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
134
Summary
Basic function
Sinusoidal transforms
(a) Discrete Fourier Transform cos sinie iθ θ θ= +( )
(b) Discrete Cosine Transform cosθi θ(c) Discrete Sine Transform
(d) Hartly Transform
sinθ
cos sinθ θ+cos sinθ θ+
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
135
Summary
Rectangular wave transforms
(a) Hadamard Transform( )
(b) Walsh Transform
(c) Slant Transform
(d) Haar Transform
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
136
Summary
Eigenvector-based transforms
(a) Hotelling Transform (K-LT)( ) g ( )
(b) SVD Transform
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
137
Homework
(1) 计算下图的 DFT, DCT, Hadamard 变换和Haar 变换变换
0 1 1 00 1 1 00 1 1 00 1 1 00 1 1 0
(2) Page 71(章毓晋) 3 21: 设有一组64*64的图像(2) Page 71(章毓晋) 3.21: 设有一组64*64的图像,它们的协方差矩阵式单位矩阵.如果只使用一半的原始特征值计算重建图像,那么原始图像和重建图原始特征值计算重建图像,那么原始图像和重建图像间的均方误差是多少?
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
138
The End
Digital Image Processing Prof.zhengkai Liu Dr.Rong Zhang
139