cs654: digital image analysis lecture 15: image transforms with real basis functions

17
CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Upload: caitlin-parrish

Post on 12-Jan-2016

230 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

CS654: Digital Image Analysis

Lecture 15: Image Transforms with Real Basis Functions

Page 2: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Recap of Lecture 14

• Discrete Fourier Transform

• Orthogonal sinusoidal waveform

• Computational complexity is high

• Involves complex multiplication

Page 3: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Outline of Lecture 15

• Basis function with real (Integer) values

• Hadamard Transform

• Haar Transform

• KL Transform

Page 4: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Hadamard Transform

• Real, orthogonal, symmetric

• Elements of the basis vectors are

• Hadamard transformation matrix

𝐻1=1√2 [1 1

1 −1 ]𝑁=2𝑛 ,𝑛=1 ,2,3 ,…

Core matrix

Page 5: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Generation of transformation matrix

• Using Kronecker product recursion

𝐻𝑛=𝐻𝑛− 1⨂𝐻1

𝐻2=𝐻1⨂𝐻1

Example

¿ 12 [1 11 −1]⨂ [1 1

1 −1]

¿ 12 [[1 11 −1] [1 1

1 −1][1 11 −1] −[1 1

1 −1] ]𝐻𝑛=

1√2 [𝐻𝑛− 1 𝐻𝑛− 1

𝐻𝑛− 1 −𝐻𝑛−1]

𝑛=log 2𝑁

Page 6: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Unitary Hadamard Transform

• General unitary transformation equation

• Using Hadamard transform

𝑣=𝐴𝑢

𝑢=𝐴∗𝑇 𝑣

Forward transformation

Inverse transformation

𝑣=𝐻𝑢

𝑢=𝐻∗𝑇𝑣=𝐻𝑣

Forward transformation

Inverse transformation

Dimension of ?

What happens in case of images?

Page 7: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Summation expression

𝑣 (𝑘 )= 1√ 𝑁 ∑

𝑚=0

𝑁−1

𝑢 (𝑚)(−1 )𝑏(𝑘 ,𝑚),0≤𝑘≤𝑁−1Forward transformation

𝑢 (𝑚 )= 1√𝑁 ∑

𝑘=0

𝑁 −1

𝑣 (𝑘)(−1 )𝑏(𝑘 ,𝑚),0≤𝑚≤𝑁−1Inverse transformation

Binary representation of

𝑘=𝑘020+𝑘12

1+…+𝑘𝑛−12𝑛−1

𝑚=𝑚020+𝑚12

1+…+𝑚𝑛−12𝑛−1

LSB, MSB ?

𝑏 (𝑘 ,𝑚 )=∑𝑖=0

𝑛− 1

𝑘𝑖𝑚𝑖

Page 8: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Properties of Hadamard Transformation

𝐻3=1√8 [

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 11 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

]Sequency

0

7

3

4

1

6

2

5

Page 9: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Natural Ordering vs. Sequency Ordering

Natural Order (h)

Binary Gray of s Sequency

Binary Sequency

(s)

0 000 000 0

1 001 111 7

2 010 011 3

3 011 100 4

4 100 001 1

5 101 110 6

6 110 010 2

7 111 101 5

000

100

010

110

001

101

011

111

Natural order of the Hadamard transform coefficients = bit reversed gray code representation of its sequency

Page 10: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Haar Transform

• Haar functions , is defined for and

• The order of the function is uniquely decomposed into two integers

𝑘=2𝑝+𝑞−1

Where,

for

for

Page 11: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Haar Function

• Representing by , the Haar functions are defined as:

h0 (𝑥 )=h0,0 (𝑥 )= 1√𝑁

,𝑥∈[0,1]

h𝑘 (𝑥 )=h𝑝 ,𝑞 (𝑥 )= 1√ 𝑁 { 2

𝑝2 ,𝑞−12𝑝

≤𝑥<𝑞− 1

22𝑝

−2𝑝2 ,𝑞− 1

22𝑝

≤𝑥< 𝑞2𝑝

0 , h𝑜𝑡 𝑒𝑟𝑤𝑖𝑠𝑒 𝑓𝑜𝑟 𝑥∈[0,1]

takes discrete values at

Page 12: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Haar Basis Function Computation

Determine the order of N

Determine

Determine

Determine

Determine the sequence

Calculate the Haar function

Example: Haar basis for

𝑛=log 22=1

𝑝=0 ;𝑞=0𝑜𝑟 1

𝒙=𝟎𝟐,𝟏𝟐

Page 13: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Haar Basis Function Computation

Case 1:

h0 (𝑥 )=h0,0 (𝑥 )= 1√2,𝑥∈[0,1]

Case 2:

For

For 𝑘

𝑛

𝑘

𝑛𝑘𝑛

Page 14: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Haar basis for N=2

Page 15: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

KL Transform

• Exploits the statistical properties of an image

• Basis functions are orthogonal Eigen vectors of the covariance matrix

• Optimally de-correlates the input data

• Energy compaction

• Input dependent, and high computational complexity

Page 16: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Eigen analysis

Let, be a vector of random variables

Auto-correlation matrix 𝐸 [�⃗� �⃗�∗𝑇 ]

: Eigen values of

: Eigen vectors of

KL Transform of is defined as: �⃗�=𝚽∗𝑻 �⃗�

Inverse Transform is defined as: �⃗�=𝚽 �⃗�= ∑𝒌=𝟎

𝑵 −𝟏

𝒗 (𝒌 ) �⃗�𝒌

𝑅𝜙𝑘=𝜆𝑘𝜙𝑘 0≤𝑘≤𝑁−1

𝚽∗𝑻 𝑹𝚽=𝚲=𝑫𝒊𝒂𝒈 {𝝀𝒌}

Page 17: CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions

Thank youNext Lecture: Convolution and Correlation