30
Image transforms of Image compression Presenter: Cheng-Jin Kuo 郭郭郭 Advisor: Jian-Jiun Ding, Ph. D. Professor 郭郭郭郭郭 Digital Image & Signal Processing Lab Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC

Image transforms of Image compression

Embed Size (px)

DESCRIPTION

Image transforms of Image compression. Presenter: Cheng-Jin Kuo 郭政錦 Advisor: Jian-Jiun Ding, Ph. D. Professor 丁建均教授 Digital Image & Signal Processing Lab Graduate Institute of Communication Engineering National Taiwan University, Taipei, Taiwan, ROC. Outline. Introduction - PowerPoint PPT Presentation

Citation preview

Page 1: Image transforms of Image compression

Image transforms of Image compression

Presenter: Cheng-Jin Kuo 郭政錦Advisor: Jian-Jiun Ding, Ph. D.

Professor 丁建均教授Digital Image & Signal Processing Lab

Graduate Institute of Communication EngineeringNational Taiwan University, Taipei, Taiwan, ROC

Page 2: Image transforms of Image compression

Outline

IntroductionImage compression schemeImage TransformOrthogonal TransformDCT transformSubband TransformHaar Wavelet transform

Page 3: Image transforms of Image compression

Introduction

• Image types:bi-level imagegrayscale imagecolor image : e.g. RGB, YCbCrcontinuous-tone image : -natural scene; -image noise; -clouds, mountains, surface of lakes;

Page 4: Image transforms of Image compression

Introduction

discrete-tone image(graphical image or synthetic image) :

-artificial image;

-sharp and well-defined edges;

-high contrasted from the background; cartoon-like image:

-uniform color;

Page 5: Image transforms of Image compression

Introduction

• The principle of Image compression:

removing the redundancy

-the neighboring pixels are highly correlated

-the correlation is called spatial redundancy

Page 6: Image transforms of Image compression

Image compression scheme Arithmetic coding,

Huffman coding,

1.Orthogonal transform(Walsh-Hamadard transform, RLE, …….

DCT, …)

2.Subband transform(wavelet transform, …)

quantization error

image transform quantizer encoder

Compressed image filedecoder

Inverse transform

image’

Page 7: Image transforms of Image compression

Image transform

• Two properties and main goals:

-to reduce image redundancy

-to isolate the various freq. of the image

(identify the important parts of the image)

Page 8: Image transforms of Image compression

Image transform

• Two main types:

-orthogonal transform:

e.g. Walsh-Hdamard transform, DCT

-subband transform:

e.g. Wavelet transform

Page 9: Image transforms of Image compression

Orthogonal transform

• Orthogonal matrix W

C=W . D

Reducing redundancyIsolating frequencies

11 12 13 14

21 22 23 24

31 32 33 34

41 42 43 44

w w w w

w w w w

w w w w

w w w w

1

2

3

4

c

c

c

c

1

2

3

4

d

d

d

d

Page 10: Image transforms of Image compression

Orthogonal transform

• One choice of W:

(Walsh-Hadamard transform)

C=W . D

• W should be Invertible (for inverse transform)

• Other properties?

1 1 1 1

1 1 1 1

1 1 1 1

1 1 1 1

Page 11: Image transforms of Image compression

Orthogonal transform

• Reducing redundancy (Energy weighted)

• example: d=[5 6 7 8]

after multiply by W/2 c=[13 -2 0 -1]

energy of d = energy of c= 174

• energy ratio of the first index:

d:25/174 =14%

c:169/174 =97%

Page 12: Image transforms of Image compression

Orthogonal transform

• Reducing redundancy (Energy weighted)

• d=[4 6 5 2] ; c=[8.5 1.5 -2.5 0.5] ; E=81

In general, we ignore several smallest elements in d’, and get c=[8.5 0 -2.5 0]

quantize it and get the inverse

c=[3 5.5 5.5 3]

E=81.75

• Property 1: should be large while others, small.1c

Page 13: Image transforms of Image compression

Orthogonal transform

• Isolating frequencies (freq. weighted)

• example:

d=[1 0 0 1]c=[2 0 2 0] W=

d=0.5[1 1 1 1]+0.5[1 -1 -1 1]

d=[0 0.33 -0.33 -1]c=[0 2.66 0 1.33]

d=0.66[1 1 -1 -1]+0.33[1 -1 1 -1]

1 1 1 1

1 1 1 1

1 1 1 1

1 1 1 1

Page 14: Image transforms of Image compression

Orthogonal transform

• Isolating frequencies (freq. weighted)

• Property 2: should correspond to zero freq. while other coefficients correspond to higher and higher freq.

W= , W=

(Walsh-Hadamard transform)

1 1 1 1

1 1 1 1

1 1 1 1

1 1 1 1

1 jc

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

Page 15: Image transforms of Image compression

Orthogonal transform

• So how do we choose W?

Invertible matrixCoefficients in the first row are all positiveEach row represents the different freq.

Orthogonal matrix

Page 16: Image transforms of Image compression

Orthogonal transform

L L L L L L L L L S S S S S S S L S S S S S S S

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

L L L L L L L L L S S S S S S S S s s s s s s s

Page 17: Image transforms of Image compression

Discrete Cosine Transform

• W matrix of DCT:

• W=

3 5 7 9 11 13 1516 16 16 16 16 16 16 16

cos 0 1 1 1 1 1 1 1 1

cos1 0.981 0.831 0.556 0.195 0.195 0.556 0.831 0.981

cos 2 0.924 0.383 0.383 0.924 0.924 0.383 0.383 0.924

cos3 0.831 0.195 0.981 0.556 0.556 0.981 0.195 0.831

cos 4

0.707 0.707 0.707 0.707 0.707 0.707 0.707 0.707

cos5 0.556 0.981 0.195 0.831 0.831 0.195 0.981 0.556

cos 6 0.383 0.924 0.924 0.383 0.383 0.924 0.924 0.383

cos 7 0.195 0.556 0.831 0.981 0.981 0.831 0.556 0.195

Page 18: Image transforms of Image compression

Discrete Cosine Transform

• 1D DCT: , for f=0~7

= , f=0

1 , f>0

• Inverse DCT(IDCT):

7

0

1 (2 1)cos[ ]

2 16f f tt

t fG C p

fC 12

7

0

1 (2 1)cos[ ], 0,1,......,7

2 16t j jj

t jP C G for t

Page 19: Image transforms of Image compression

Discrete Cosine Transform

• 2D DCT:

• Inverse DCT(IDCT):

1 1

0 0

1 (2 1) (2 1)cos[ ]cos[ ] ,for 0 , 1

2 22

n n

ij i j xyx y

y j x iG C C p i j n

n nn

7

0

1 (2 1)cos[ ], for t=0,1, ..., 7

2 16t j jj

t jP C G

Page 20: Image transforms of Image compression

Discrete Cosine Transform

Page 21: Image transforms of Image compression

Subband Transform

• Separate the high freq. and the low freq. by subband decomposition

Page 22: Image transforms of Image compression

Subband Transform

• Filter each row and downsample the filter output to obtain two N x M/2 images.

• Filter each column and downsample the filter output to obtain four N/2 x M/2 images

Page 23: Image transforms of Image compression

Haar wavelet transform

• Haar wavelet transform:

Average : resolutionDifference : detail

Example for one dimension

Page 24: Image transforms of Image compression

Haar wavelet transform

• Example: data=(5 7 6 5 3 4 6 9)

-average:(5+7)/2, (6+5)/2, (3+4)/2, (6+9)/2

-detail coefficients:

(5-7)/2, (6-5)/2, (3-4)/2, (6-9)/2

• n’= (6 5.5 3.5 7.5 | -1 0.5 -0.5 -1.5)

• n’’= (23/4 22/4 | 0.25 -2 -1 0.5 -0.5 -1.5)

• n’’’= (45/8 | 1/8 0.25 -2 -1 0.5 -0.5 -1.5)

Page 25: Image transforms of Image compression

Haar wavelet transform

Page 26: Image transforms of Image compression

Subband Transform

Page 27: Image transforms of Image compression

Subband Transform

• The standard image wavelet transform

• The Pyramid image wavelet transform

Page 28: Image transforms of Image compression

Subband Transform

HL

LH HH

LL

Page 29: Image transforms of Image compression

Subband Transform

Page 30: Image transforms of Image compression

Reference• David Salomon, Coding for Data and Computer

Communication, Springer, 2005.• A. Uhl, A. Pommer, Image and Video Encryption,

Springer, 2005• David Salomon, Data Compression - The Complete

Reference 3rd Edition, Springer, 2004.• Khalid Sayood, Introduction to Data Compression 2nd

Edition, Morgan Kaufmann, 2000.• J.Goswami, A.Chan, Fundamentals of Wavelets – Theory,

Algorithms, and Application, Wiley Interscience, 1999• C.S. Burrus, R. A. Gopinath, H. Guo, Introduction to

Wavelets and Wavelet Transforms – A Primer, Prentice-Hall, 1998