30
Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project [email protected]

Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project [email protected]

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

Wavelet-based CodingAnd its application in JPEG2000

Monia GhobadiCSC561 project

[email protected]

Page 2: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

2

Agenda

Why Wavelet Transform Continuous & Discrete Wavelet

Transform Haar Wavelet Transform Application of wavelet transform is

JPEG2000: EZW coding

Page 3: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

3

Introduction Multimedia Transformations are applied

to signals to obtain further information. Most of the signals in practice, are

time-domain signals in their raw format.

Not always the best representation of the signal.

The most distinguished information is hidden in the frequency content.

Page 4: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

4

Fourier Transform The frequency spectrum of the signal shows

what frequencies exist in the signal FT

Frequency domain Temporal domain

No frequency information is available in time-domain

No time information is available in frequency-domain signal

Page 5: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

5

Stationary Signalsx(t)=cos(2π*10t)+cos(2 π *25t)+cos(2 π *50t)+cos(2 π *100t)

FT

Four spectral components corresponding to the frequencies 10, 25, 50, 100 Hz

Page 6: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

6

Non-stationary Signals

FT

Four different frequency components at four different time intervals

Page 7: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

7

Comparison of two examples Two spectrums are similar! Four spectral components at exactly the same

frequencies The corresponding time domain signals are not even

close

Page 8: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

8

What is wavelet transform? Provides time-frequency representation Wavelet transform decomposes a signal

into a set of basis functions (wavelets) Wavelets are obtained from a single

prototype wavelet Ψ(t) called mother wavelet by dilations and shifting:

where a is the scaling parameter and b is the shifting parameter

)(1

)(, a

bt

atba

Page 9: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

9

Wavelet Transform

Continuous Wavelet Transform (CWT)

Discrete Wavelet Transform (DWT)

Page 10: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

10

CWT

Continuous wavelet transform (CWT) of 1D signal is defined as

The a,b is computed from the mother wavelet by translation and dilation

dxxxfbfW baa )()()( ,

abx

axba

1)(,

Page 11: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

11

Separates the high and low-frequency portions of a signal through the use of filters One level of transform:

Signal is passed through G & H filters. Down sample by a factor of two

Multiple levels (scales) are made by repeating the filtering and decimation process on lowpass outputs

1D Discrete Wavelet Transform

Page 12: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

12

Haar Wavelet Transform Find the average of each pair of samples Find the difference between the average and

sample Fill the first half with averages Fill the second half with differences Repeat the process on the first half Step 1:

[3 5 4 8 13 7 5 3]

[4 6 10 4 -1 -2 3 1]

Averaging

Differencing

Page 13: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

13

Haar Wavelet Transform Step 2

[4 6 10 4 -1 -2 3 1]

[5 7 -1 3 -1 -2 3 1]

ex. (4 + 6)/2 = 5 4 - 5 = -1

Averaging Differencing

Page 14: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

14

Haar Wavelet Transform Step 3

[5 7 -1 3 -1 -2 3 1]

[6 -1 -1 3 -1 -2 3 1]

ex. (5 + 7)/2 = 6 5 - 6 = -1

Averaging Differencing

row average

Page 15: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

15

Image representation

[33 32 33 32 31 -29 27 -25][32.5 32.5 0.5 0.5 31 -29 27 -25][32.5 0 0.5 0.5 31 -29 27 -25]

163624559588

5610115352141549

4818194544222341

2539382829353432

3331303637272640

2442432120494717

165051131254559

577660613264

A

Page 16: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

16

Applying on rows

3129272550500532

2321191750500532

151311950500532

753150500532

135750500532

911131550500532

1719212350500532

2527293150500532

...

...

...

...

...

...

...

...

row averagedetail coefficients

Page 17: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

17

Applying on columns

Choose a threshold δ

272523215500

11975505000

579115500

21232527505000

44440000

44440000

00000000

0000000532

..

..

..

..

.

δ = 5

272523210000

119700000

079110000

212325270000

00000000

00000000

00000000

0000000532.

Page 18: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

18

Decompressing

apply the inverse of the averaging the differencing operations

555595575759555553511

559555755755559511553

521543523541539525532532

543521541523525539532532

532532525539541523521543

532532539525523541543521

511553555595755755955

553511595555575755559

........

........

........

........

........

........

........

........

Page 19: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

19

Result

Decompressed ImageOriginal Image

Page 20: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

20

2-D DWT Step 1: replace each row with its 1-D DWT. Step 2: Replace each column with its 1-D DWT Step 3: Repeat steps 1 & 2 on the lowest

subband for the next scale. Step 4: Repeat step 3 until as many scales as

desired

original

L HLH HH

HLLL

LH HH

HL

One scale two scales

Page 21: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

21

Discrete Wavelet Transform

LL2 HL2

LH2 HH2HL1

LH1 HH1

Page 22: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

22

JPEG2000 (J2K) is an emerging standard for image compression Achieves low bit rate compression

Not only better efficiency, but also more functionality

Lossless and lossy compression

JPEG2000

Page 23: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

23

JPEG2000 v.s. JPEG

low bit-rate performance

Page 24: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

24

Embedded Zero Tree Wavelet Coding

The era of modern lossy wavelet coding began in 1993 when Jerry Shapiro introduced EZW coding

Improved performance at low bit rates relative to the existing JPEG standard.

Much of the energy in the wavelet transform is concentrated into the LLk band.

Page 25: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

25

Significance map An indication of whether a particular

coefficient is zero or nonzero relative to a given quantization level.

EZW determined a very efficient way to code significance maps.

A wavelet coefficient is insignificant if |x| < T.

By coding the location of zeros.

Page 26: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

26

EZW algorithm If a wavelet coefficient at a coarse scale

is insignificant, then all wavelet coefficients of the same orientation in the same spatial location at finer scales are likely to be insignificant.

Tree Structure: Recognizing the coefficients of the same spatial location

Zero tree: set of insignificant coefficients

Page 27: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

27

DWT for Image decomposition

Page 28: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

28

Zero Tree

A coefficient is part of a zero tree if it’s zero and all of its descendents are zero

Efficient for coding: by declaring only one coefficient a zero tree root, all descendants are known to be zero

Page 29: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

29

Implementation

Implementing 2D DWT image compression algorithm

A JPEG2000 like implementation: EZW coding Haar wavelet transform

Page 30: Wavelet-based Coding And its application in JPEG2000 Monia Ghobadi CSC561 project monia@cs.uvic.ca

30

Question