Transform Based Compression. Optimal Quantization (Lloyd-Max) Image Transforms

Optimal Quantization (Lloyd-Max) ti ti 2 Throwing out DFT coefficients 1 1   si    si Original 2:1 3:1 4:1     s t i p...
0 downloads 1 Views 378KB Size
Optimal Quantization (Lloyd-Max) ti ti 2

Throwing out DFT coefficients

1

1





si







si

Original

2:1

3:1

4:1











s t i p s ds 0







si

Transform Based Compression







Minimize mean square quantization error: E s q s Consider only even PDF of data, p(s) = p(-s) Leads to odd quantizer function, q(s) = -q(-s) si – decision levels

2

ti – reconstruction levels Optimum decision levels lie halfway between the optimum reconstruction levels, which, in turn, lie at the centroid of the PDF in between the decision levels. 1

chapt08p3.sxi

2

chapt08p3.sxi

Image Transforms

Image Transforms g(x,y,u,v) form an orthonormal basis: 









 













3

chapt08p3.sxi



g2 x , u





g1 x , u



Symmetric transform if:

x , y ,u ,v



h

g1 x , u g 2 y , v







g x , y ,u ,v



g x , y ,u ,v

Unitary transform if:







 





if u u ' and v v ' otherwise

T x , y h x , y ,u ,v

u 0 v 0

chapt08p3.sxi

1 0

Separable transform if:

N 1 N 1











x 0 y 0

General reverse transform:

*

g x , y , u , v g x , y , u' , v '

x 0 y 0

f u ,v

 

 











f x , y g x , y ,u,v



T u ,v

N 1 N 1





N 1 N 1

General forward transform:

4

Discrete Fourier Transform (DFT)

Walsh-Hadamard Transform (WHT)

DFT:

Sequency

0 1



1 ux vy WN WN 2 N 





W

vy N

2



h x , y ,u ,v

W



g x , y ,u ,v

ux N

Unitary DFT:

3

1 ux vy W WN N N

5







1 ux vy W WN N N



h x , y ,u ,v

4



g x , y ,u ,v

6 5

7

cos

$ %

2y 1 v 2N 



2x 1 u 2N #





v cos

!

u

!





h x , y ,u ,v



for u 0 N

1

,

for u 1

+

Summation in modulo-2 arithmetic bk(z) is kth bit of z = (b7b6b5b4b3b2b1b0)

*

(

u

1 N 2 N



m

&'



*)





g x , y ,u ,v

#

" 

bi y pi v



bi x pi u



i 0



    

m 1

1







2



N





1 N

h x , y ,u ,v

Discrete Cosine Transform (DCT) "

Walsh-Hadamard Transform (WHT) g x , y ,u ,v

6

chapt08p3.sxi

$ %

chapt08p3.sxi

WHT and DCT are both fast transforms – FFT-like algorithms exist. DCT is not the real part of the DFT

pk(z):







convert z to Gray code reverse bits of the Gray code pk(z) is the kth bit of the result

chapt08p3.sxi

7

chapt08p3.sxi

8

0

Basis Images and Energy Compaction

-

Basis Images (

1

T u , v H uv 2

5

(

/ ,





u 0 v 0

4

8

1 N

8

N

F

0 1

if T u , v is neglected otherwise

(

1, u , v



5

4



 9

10

chapt08p3.sxi

@

@

@

2 5

log2 MN log2 mn

MN mn

log2 512

2

log2 16

2

9 4

5

@

mnlog2 mn

MN log2 MN

4

The Karhunen-Loève transform (KLT) has optimal energy compaction properties – KLT depends upon the image data. DCT usually is the best practical transform in terms of energy compaction and minimization of blocking artifacts.

Image is subdivided into typical block sizes of 8x8 or 16x16 before transform encoding. Provides (some) gain in computational efficiency:

5

Different transforms achieve a different distribution of coefficient variance, σ2T(u,v) , over transform space (u,v).

@

@

Sub Image Size

@

Energy Compaction

5

chapt08p3.sxi

1 T u,v

44

2 T u,v

u 0 v 0

2

1

3

1 N

 2

N

ems

@

> 3

3

12

u u0 , v v 0

? 8 

v0

8 

0

2

4

1



Trans



5

Hu

F

3

F

5

ems E

=

Suggest Documents