Transcript Document

Wavelet-based Coding
And its application in JPEG2000
Monia Ghobadi
CSC561 project
[email protected]
Agenda




Why Wavelet Transform
Continuous & Discrete Wavelet
Transform
Haar Wavelet Transform
Application of wavelet transform is
JPEG2000:

EZW coding
2
Introduction




Multimedia Transformations are applied
to signals to obtain further information.
Most of the signals in practice, are timedomain signals in their raw format.
Not always the best representation of
the signal.
The most distinguished information is
hidden in the frequency content.
3
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
4
Stationary Signals
x(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
5
Non-stationary Signals
FT
Four different frequency components at
four different time intervals
6
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
7
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:
1
t b
 a ,b (t ) 
(
)
a
a
where a is the scaling parameter and b is the shifting
parameter
8
Wavelet Transform


Continuous Wavelet Transform (CWT)
Discrete Wavelet Transform (DWT)
9
CWT

Continuous wavelet transform (CWT) of
1D signal is defined as
Wa f  (b)   f ( x )  a ,b ( x ) dx

The a,b is computed from the mother
wavelet by translation and dilation
1  x  b
 a ,b ( x ) 


a  a 
10
1D Discrete Wavelet Transform
 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
11
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]
Averaging
Differencing
[4 6 10 4 -1 -2 3 1]
12
Haar Wavelet Transform

Averaging
Step 2
[4 6 10
4 -1 -2 3 1]
Differencing
[5 7 -1 3 -1 -2 3 1]
ex. (4 + 6)/2 = 5
4 - 5 = -1
13
Haar Wavelet Transform

Step 3
[5 7 -1 3 -1 -2 3 1]
Averaging
Differencing
[6 -1 -1 3 -1 -2 3 1]
row average
ex. (5 + 7)/2 = 6
5 - 6 = -1
14
Image representation
64
9

17

40

A
 32

 41
49

 8
[33
32
33
[32.5 32.5 0.5
[32.5
0
0.5
32
0.5
0.5
2
55
47
26
34
23
15
58
3
54
49
27
35
22
14
59
61
12
20
37
29
44
52
5
60
13
21
36
28
45
53
4
6
51
43
30
38
19
11
62
7
50
42
31
39
18
10
63
57
16
24

33
25

48
56

1 
31 -29 27 -25]
31 -29 27 -25]
31 -29 27 -25]
15
Applying on rows
 32.5
 32.5

 32.5

 32.5
 32.5

 32.5
 32.5

 32.5
0
0
0
0
0
0
0
0
row average
0.5
 0.5
 0.5
0.5
0.5
 0.5
 0.5
0.5
0.5
31  29 27  25
 0.5  23 21  19 17 
 0.5  15 13  11 9 

0.5
7
5
3
1 
0.5
1
3
5
7 

 0.5
9
 11 13  15
 0.5 17  19 21  23

0.5  25 27  29 31 
detail coefficients
16
Applying on columns

Choose a threshold δ
0 5 00
 32.5  32.
 0  00 00


 0  00 00


0

 00 00
 0  00 0.05


 0  00  .05
 0  00 0.05


 0  00  .05
00 0
00 0
00 0
00 0
00.50
0 .50
00.50
0 .50
00
00
40
40
27
27
11
11
 05
21
21
00
00
 04
 04
25
25
99
77
23
23
00
00
40
40
23
23
77
99
25
25
00 
00 
 04 

 04 
21
21

50 
11
11 

27
27
δ=5
17
Decompressing

apply the inverse of the averaging the
differencing operations
59.5
 5.5

 21.5

43.5
 32.5

 32.5
53.5

11.5
5.5
59.5
43.5
21.5
32.5
32.5
11.5
53.5
7.5
57.5
41.5
23.5
39.5
25.5
9.5
55.5
57.5
7.5
23.5
41.5
25.5
39.5
55.5
9.5
55.5
9.5
25.5
39.5
23.5
41.5
57.5
7.5
9.5
55.5
39.5
25.5
41.5
23.5
7.5
57.5
11.5
53.5
32.5
32.5
21.5
43.5
5.5
59.5
53.5
11.5 
32.5

32.5
43.5

21.5
59.5

5.5 
18
Result
Original Image
Decompressed Image
19
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
L
original
H
LL
HL
LH
HH
One scale
HL
LH
HH
two scales
20
Discrete Wavelet Transform
LL2
HL2
LH2
HH2
LH1
HL1
HH1
21
JPEG2000

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
22
JPEG2000
v.s. JPEG
low bit-rate performance
23
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.
24
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.
25
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
26
DWT for Image decomposition
27
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
28
Implementation


Implementing 2D DWT image
compression algorithm
A JPEG2000 like implementation:


EZW coding
Haar wavelet transform
29
Question
30