Image transforms of Image compression

Preview:

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

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

Outline

IntroductionImage compression schemeImage TransformOrthogonal TransformDCT transformSubband TransformHaar Wavelet transform

Introduction

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

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;

Introduction

• The principle of Image compression:

removing the redundancy

-the neighboring pixels are highly correlated

-the correlation is called spatial redundancy

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’

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)

Image transform

• Two main types:

-orthogonal transform:

e.g. Walsh-Hdamard transform, DCT

-subband transform:

e.g. Wavelet transform

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

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

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%

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

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

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

Orthogonal transform

• So how do we choose W?

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

Orthogonal matrix

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

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

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

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

Discrete Cosine Transform

Subband Transform

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

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

Haar wavelet transform

• Haar wavelet transform:

Average : resolutionDifference : detail

Example for one dimension

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)

Haar wavelet transform

Subband Transform

Subband Transform

• The standard image wavelet transform

• The Pyramid image wavelet transform

Subband Transform

HL

LH HH

LL

Subband Transform

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

Recommended