Anda di halaman 1dari 31

The Discrete Wavelet Transform

for Image Compression


Speaker: Jing-De Huang
Advisor: Jian-Jiun Ding
Graduate Institute of Communication Engineering
National Taiwan University, Taipei, Taiwan, ROC
Outline
• Subband Coding
• Multiresolution Analysis
• Discrete Wavelet Transform
• The Fast Wavelet Transform
• Wavelet Transforms in Two Dimension
• Image Compression
• Simulation Result

2
1. Subband Coding
h0(n) 2 2 g0(n)
y0 ( n )

x ( n) Analysis Synthesis + xˆ (n)

y1 (n)
h1(n) 2 2 g1(n)

H1 ( ) H1 ( )

Low band High band


0 /2 
3
1. Subband Coding
• Cross-modulated
Z-transform
Xˆ ( z )   H 0 ( z )G0 ( z )  H1 ( z )G1 ( z )  X ( z )
1
2

:  12  H 0 ( z )G0 ( z )  H1 ( z )G1 ( z )  X ( z )

For error-free reconstruction Xˆ ( z )  X ( z ) 
H 0 ( z )G0 ( z )  H1 ( z )G1 ( z )  0
H 0 ( z )G0 ( z )  H1 ( z )G1 ( z )  2
For finite impulse response (FIR) filters and ignoring the delay
g 0 (n)  (1) n h1 (n)
g1 (n)  ( 1) n 1 h0 (n)
FIR synthesis filters are cross-modulated copies of the analysis filters 
with one (and only one) being sign reversed. 4
1. Subband Coding
• Biorthogonal
g 0 (k ), h0 (2n  k )   (n), g 0 ( k ), h1 (2n  k )  0
g1 (k ), h1 (2n  k )   (n), g1 (k ), h0 (2n  k )  0
hi (2n  k ), g j (k )   (i  j ) ( n), i, j  {0,1}

The analysis and synthesis filter impulse responses of all two-band,

real-coefficient, perfect reconstruction filter banks are subject to the


biorthogonality constraint

5
1. Subband Coding
• Orthonormal
– gi (n), g j (n  2m)   (i  j ) (m), i, j  {0,1}
– one solution of biorthogonal
– used in the fast wavelet transform
– the relationship of the four filter is :
g1 (n)  ( 1) n g 0 (2 K  1  n) , 2K denotes the number of coefficients
 g1 (n) is related to g 0 (n)
hi (n)  gi (2 K  1  n), i  {0,1}
 h1 (n), h2 (n) is time-reversed versions of g1 (n), g 2 (n), respectively

6
2. Multiresolution Analysis
• Expansion of a signal f (x) :
f ( x)    kk ( x)  k : real-valued expansion coefficients
k k ( x) : real-valued expansion functions

 k  k ( x), f ( x)   k* ( x) f ( x)dx k ( x): the dual function of k ( x)


If  k ( x) is an orthonormal basis for V , then k ( x)  k ( x)

If the expansion is unique, the k ( x) are called basis functions.


The function space of the expansion set k ( x) : V  span  k ( x )
k

If  k ( x) are not orthonormal but are an orthogonal basis for V ,


then the basis funcitons and their duals are called biorthogonal.
0 , j  k
Biorthogonal:  j ( x), k ( x)   jk  
1 , j  k
7
2. Multiresolution Analysis
• Scaling function
 j ,k ( x)  2 j / 2  (2 j x  k ), for k  Z and  ( x)  L2  R 
The subspace spanned over k for any j : V j  span  j ,k ( x )
k
 

The scaling functions of any subspace can be built from double-


resolution copies of themselves. That is,
 ( x)   h (n) 2 (2 x  n)
n
where the coefficients are called scaling function coefficients.

8
2. Multiresolution Analysis
• Requirements of scaling function:
1. The scaling function is orthogonal to its integer translates.

2. The subspaces spanned by the scaling function at low scales are neste
d within those spanned at higher scales.
That is V V V V V V
 1 0 1 2 
Vj f ( x)  0
3. The only function that is common to all is .
That is V   0

4. Any function can be represented with arbitrary precision.



That is, V  L2  R  

9
2. Multiresolution Analysis
• Wavelet function
spans the difference between any two adjacent scaling subspaces
V j and V j 1

 j ,k ( x)  2 j / 2 (2 j x  k ) for all k  Z that spans the space W j



where W j  span  j ,k ( x)
k

The wavelet function can be expressed as a weighted sum of sh
ifted, double-resolution scaling functions. That is,
 ( x)   h (n) 2 (2 x  n)
n
where the h (n) are called the wavelet function coefficients.

It can be shown that h (n)  ( 1) h (1  n)


n

10
2. Multiresolution Analysis
V2  V1  W1  V0  W0  W1
V1  V0  W0
W1
W0
V0

Figure 2 The relationship between scaling and wavelet function spaces.

The scaling and wavelet function subspaces in Fig. 2 are related by


V j 1  V j  W j
We can express the space of all measurable, square-integrable function as
L2  R   V0  W0  W1  W2  
or L  R     W2  W1  W0  W1  W2  
2

11
3 Discrete Wavelet Transform
• Wavelet series expansion

f ( x)   c j0 (k ) j0 ,k ( x)    d j (k ) j ,k ( x)
k j  j0 k

where j0 is an arbitrary starting scale

c j0 (k )  f ( x), j0 ,k ( x)   f ( x)j0 ,k ( x)dx


called the approximation or scaling coefficients

d j (k )  f ( x), j ,k ( x)   f ( x) j ,k ( x)dx


called the detail or wavelet coefficients

12
3 Discrete Wavelet Transform
• Discrete Wavelet Transform
the function f(x) is a sequence of numbers

1 1
f ( x) 
M
k  0 j0 ,k
W ( j , k ) ( x ) 
M
 
j j k
W ( j , k ) j ,k ( x)
0

where j0 is an arbitrary starting scale


M 1
1
W ( j0 , k ) 
M
 f ( x)
x 0
j0 , k ( x)

called the approximation or scaling coefficients


M 1
1
W ( j , k ) 
M
 f ( x)
x 0
j,k ( x)

called the detail or wavelet coefficients


13
4 The Fast Wavelet Transform
• Fast Wavelet Transform (FWT)
– computationally efficient implementation of the DWT
– the relationship between the coefficients of the DWT at adjacent
scales
– also called Mallat's herringbone algorithm
– resembles the twoband subband coding scheme

14
4 The Fast Wavelet Transform
Scaling x by 2j, translating it by k, and lettin
 ( x)   h (n) 2 (2 x  n)
n
g m = 2k + n

 (2 j x  k )   h (n) 2  2(2 j x  k )  n    h (m  2k ) 2  2 j 1 x  m 
n m

Similarity
,
 (2 x  k )   h (m  2k ) 2 (2 j 1 x  m)
j

Consider the DWT. Assume  ( x)   ( x) and  ( x)   ( x)


M 1
1
W ( j0 , k )   f ( x) j0 ,k ( x)  ( x)   h (n) 2 (2 x  n)
M x 0 n
1

M
 h (m  2k )
m
2 (2 j0 x  m)

15
4 The Fast Wavelet Transform
M 1
1  j ,k ( x)  2 j / 2 (2 j x  k )
W ( j , k ) 
M
x 0
f ( x) j ,k ( x)

1

M
 x
f ( x)2 j / 2 (2 j x  k )

1 j/2  

M
x f ( x )2  
h ( m  2 k ) 2  (2 j 1
x  m ) 
m 
 1 
  h (m  2k )   f ( x )2 ( j 1) / 2
 (2 j 1
x  m ) 
m  M x 
  h (m  2k )W ( j  1, m)
m
Similarity
W ( j , k )   h (m  2k )W ( j  1, m)
,
m

16
4 The Fast Wavelet Transform
W ( j , k )  h ( n) W ( j  1, n)
n  2 k ,k 0

W ( j , k )  h ( n) W ( j  1, n)
n  2 k ,k 0

Figure 3 An FWT analysis filter bank.

17
4 The Fast Wavelet Transform

Figure 4 An FWT-1 synthesis filter bank.

By subband coding theorem, perfect reconstrucion for two-band ortho


normal filters requires gi (n)  hi for
( n)i = {0, 1}.
That is, the synthesis and analysis filters must be time-reversed versio
ns of one another. Since the FWT analysis filter are
h0 (n)  h ( n) and h1 (n)  h ( n) , the required FWT -1 synthesis filters
are g 0 (n)  h0 ( n)  h (n) and g1 (n)  h1 ( n)  h ( n) .

18
Wavelet Transform vs. Fourier Transform

• Fourier transform
– Basis function cover the entire signal range,
varying in frequency only
• Wavelet transform
– Basis functions vary in frequency (called “scale”)
as well as spatial extend
• High frequency basis covers a smaller area
• Low frequency basis covers a larger area

19
Wavelet Transform vs. Fourier Transform

Time-frequency distribution for (a) sampled data, (b) FFT, and (c) FWT basis

20
5 Wavelet Transforms in Two Dimension

Figure 5 The two-dimensional FWT  the analysis filter.

21
5 Wavelet Transforms in Two Dimension

W ( j , m, n) WH ( j , m, n)

W ( j  1, m, n)

WV ( j , m, n) WD ( j , m, n)

two-dimensional decomposition

W ( j , m, n) WH ( j , m, n)

W ( j  1, m, n)

WV ( j , m, n) WD ( j , m, n)

Figure 6 Two-scale of two-dimensional decomposition 22


5 Wavelet Transforms in Two Dimension

23
5 Wavelet Transforms in Two Dimension

Figure 7 The two-dimensional FWT  the synthesis filter bank.

24
Common Wavelet Filters
• Haar: simplest, orthogonal, not very good
• Daubechies 8/8: orthogonal
• Daubechies 9/7: bi-orthogonal
most commonly used if numerical reconstru
ction errors are acceptable
• LeGall 5/3: bi-orthogonal, integer operation,
can be implemented with integer operations
only, used for lossless image coding
25
6 Image Compression
Wavelet Entropy codi
image Quantization bitstream
coding ng

 W j (m, n) 
• Quantization q j (m, n)  sign( y j (m, n)) 
  j


– uniform scalar quantization
– separate quantization step-sizes for each subband
• Entropy coding
– Huffman coding
– Arithmetic coding

26
7 Simulation Result
I1 C I2
encoder decoder

I1: Original image with width W and height H


C: Encoded jpeg stream from I1
I2: Decoded image from C

CR (Compression Ratio) = sizeof(I1) / sizeof(C)


H W

  I1 ( x, y )  I 2 ( x, y) /( H W )
2

RMS (Root mean square error) = y 1 x 1

27
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 11.2460 CR = 10.3565
RMS = 4.1316 RMS = 4.0104

28
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 27.7401 CR = 26.4098
RMS = 6.9763 RMS = 6.8480

29
7 Simulation Result
DCT-based Wavelet-based
Original image image compression image compression

CR = 53.4333 CR = 51.3806
RMS = 10.9662 RMS = 9.6947

30
Reference
• R. C. Gonzolez, R. E. Woods, "Digital Image Processin
g second edition", Prentice Hall, 2002.
• R. C. Gonzolez, R. E. Woods, S. L. Eddins, "Digital Im
age Processing Using Matlab", Prentice Hall, 2004.
• T. Acharya, A. K. Ray, "Image Processing: Principles a
nd Applications", John Wiley & Sons, 2005.
• B. E. Usevitch, 'A Tutorial on Modern Lossy Wavelet I
mage Compression: Foundations of JPEG 2000', IEEE
Signal Processing Magazine, vol. 18, pp. 22-35, Sept.
2001.

31

Anda mungkin juga menyukai