3 The k-level 2

advertisement
朝陽科技大學委託研究計畫成果報告
零樹小波編碼之軟硬體實現與評估
Implementation and Evaluation of EZW Encoding –
Software and Hardware
計 畫 編 號:CYUT91-E-004
執行期限:91 年 1 月 1 日至 91 年 11 月 31 日
主持人:陳伯岳 助理教授 執行機構及單位名稱:資訊工程系
一、中文摘要
離散小波轉換在影像處理方面有非常廣
low frequency sub-band into 4 smaller
sub-bands. Without loss of generality, we
泛的應用,尤其是應用多重解析度表示法
方面,更顯出其優越性。而 Haar 離散小波
轉換是各種小波轉換方法中最簡單且正交
的一種。在本報告中,將提出一個新的矩
陣演算法來計算 Haar 離散小波轉換,此演
算法可藉由一次的矩陣乘法來完成二維的
Haar 離散小波轉換,同時所提出的演算法
也可以藉由一次的矩陣乘法計算 k 階的
Haar 離散小波轉換,因此一個多重解析度
表示系統便可利用矩陣演算法來建立,更
present that the matrix algorithm is also
suitable for the k-level 2-D Haar DWT and
it takes only one matrix multiplication as
能顯現出矩陣演算法的優越性。
1
well. Thus, a fully scaled multi-resolution
system is implemented with a simple yet
efficient algorithm.
Keywords:DWT、Haar DWT、matrix
algorithm, multi-resolution.
Introduction
Discrete wavelet transform (DWT) is an
efficient tool for multi-resolution analysis of
signal [1], especially in image processing [2].
Among many DWTs, the Haar discrete
wavelet transform (Haar DWT) is the
simplest and orthogonal one. It has many
features making it suitable to manipulate the
2-D image analysis [3]. Therefore, to
decompose 2-D images, we develop a new
關鍵字:離散小波轉換、Haar 離散小波轉
換、矩陣演算法、多重解析度表示。
Abstract
Discrete wavelet transform ( DWT )
has been used in a wide range of image
processing, especially in multi-resolution
representation. Among a variety of wavelets,
Haar discrete wavelet transform ( Haar
DWT ) is the simplest orthogonal one. In
this paper, we propose a new algorithm
named “matrix algorithm” for computing
Haar DWT coefficients. This algorithm can
finish a 2-D Haar DWT by applying only
one matrix multiplication. In some
applications, higher levels DWT are
performed so as to further decompose the
computational algorithm for the Haar-based
wavelet. The traditional 2-D Haar DWT
requires two 1-D DWT operations: one
along the rows and the other along the
columns. The column operation uses the
results of the row operation as an input. In
other words, it cannot be performed until the
row operation is completed. This limits the
1
parallelism of 2-D DWT computation and
high-pass filter coefficients (1 and –1). In
hence the overall system performance.
In recent years, matrix representation
for Haar wavelet application has been
proposed in the literature [4][5] and they can
be calculated by Kronecker product of
matrices. In this paper, we propose a new
algorithm named “matrix algorithm” to
implement the 2-D Haar DWT with only one
matrix multiplication. Base on this algorithm,
we present a general computational model
this paper, we combine low-pass filter
coefficients with high-pass filter coefficients
to form a filter coefficients matrix. Using
this filter coefficients matrix, we can
implement the 2-D Haar DWT by one
matrix multiplication. The matrix algorithm
is described in the following sections for
both forward DWT and inverse DWT
(IDWT).
2.1 Forward Haar DWT
2.1.1 At first, we define the original image
data as an n×n matrix N, where
n=2i,i=1,2,3….
The
low-pass
filter
coefficients (1,1) and the high-pass (1,-1)
filter coefficients are combined to form the
filter coefficients matrix:
for k-level 2-D Haar DWT. The k-level
transform requires only one matrix
multiplication as well. Thus, a fully scaled
multi-resolution system is established with a
simple yet efficient algorithm.
In section 2, the matrix algorithm is
proposed and described in details. The
general case of k-level 2-D Haar DWT is
discussed in section 3. In section 4, we
provide a numerical example for the readers
C=
2.1.2 Apply some sub-blocks Bij (2×2 matrix)
to express the original image N as follows:
to trace the algorithm and get a more clear
idea. Finally, conclusive comments can be
found in section 5.
2
The Matrix Algorithm
DWT can decompose the digital
signal into high-pass signal and low-pass
signal. The mathematical formula for 1-D
DWT
is
listed
as
follow :
 N 11 N 12 
B11  

 N 21 N 22
 N 31 N 32
B 21  

 N 41 N 42
.
 N 13 N 14 
B12  

 N 23 N 24
 N 33 N 34
B 22  

 N 43 N 44
.
.
 N 1, n  1 N 1, n 
B1, n / 2  

 N 2, n  1 N 2, n 
 N 3, n  1 N 3, n 
B 2, n / 2  

 N 4, n  1 N 4, n 
.
.
.
.
.
.
.
.
.
.
.
.
.
...
...
 Nn  1,1 Nn  1,2
 Nn  1,3 Nn  1,4
 Nn  1, n  1 Nn  1, n 
Bn / 2,1  
 Bn / 2,2   Nn ,3 Nn ,4  ... Bn / 2, n / 2   Nn , n  1 Nn , n 
N
n
,
1
N
n
,
2






an   h2 n k xk , cn   g 2 n k xk The h’s and
k
1
1
1 1
1  1 1  1


1 1  1  1


1  1  1 1 
, where Nij are the matrix elements of N.
2.1.3 Transform each Bij into an Aij (1×4
matrix) by Z-scan data rearrangement. For
example,
k
g’s are low-pass filter coefficients and
high-pass filter coefficients respectively. The
x’s are the original input data. The an and cn
are wavelet coefficients of low frequency
sub-band and high frequency sub-band
respectively. The Haar DWT has two
low-pass filter coefficients (1 and 1) and two
N12 
N
B11   11
  A11   N11 N12 N 21 N 22 
 N 21 N22 
Then we express the intermediate matrix M
2
((n/2)2×4 matrix) with Aij (i=1,2,3…n/2;
elements
j=1,2,3…n/2):
rearrangement procedures are explained as
follows:The elements in the first column of


A11   N11 N12 N 21 N 22 


 A12   N13 N14 N 23 N 24 



.


.


 A1,n / 2   N1,n 1 N1,n N 2,n 1 N 2,n  
 A  N N N N 

21
31
32
41
42




.


M
.


 A2,n / 2   N 3,n 1 N 3,n N 4,n 1 N 4,n  


.


.


 An / 2,1   N n 1,1 N n 1,2 N n ,1 N n ,2  


.




.
A

 n / 2,n / 2   N n 1,n 1 N n 1,n N n,n 1 N n,n  
M ' fill in W '11 row by row; the elements
in
M'
rearranged.
The
in the second column of M ' fill in W '12
row by row; the elements in the third
column of M ' fill in W '21 row by row;
the elements in the fourth column of M '
fill in W '22 row by row. As a result,
2.1.4 Compute the matrix M ' ((n/2)2×4
matrix) by matrix multiplication.
M'  M C
Let us denote the contents of M ' as
follows:
M ' 12
M ' 13
M ' 14 
 M ' 11
 M ' 21
M ' 22
M ' 23
M ' 24 


.
.
.
.
M '


.
.
.
.


.
.
.
.


 M '( n / 2) 2 , 1 M '( n / 2) 2 , 2 M '( n / 2) 2 , 3 M '( n / 2) 2 , 4 
2.1.5 We define an n×n matrix W and divide
it into four sub-matrices W '11 , W '12 , W '21
and W '22 (all 4 are (n/2)×(n/2) matrices).
The matrix W then looks like :
W ' 11 W ' 12 
W 
.
W ' 21 W ' 22 
M ' 1, 1
M ' 2, 1

 M '( n / 2)  1, 1
M '( n / 2)  2, 1

.
.
W ' 11  
.
.
.
.

.
.

 M '( n / 2)( n / 2 - 1)  1, 1 M '( n / 2)( n / 2 - 1)  2, 1
...
M ' 1, 2
M ' 2, 2

 M '( n / 2)  1, 2
M '( n / 2)  2, 2

.
.
W ' 12  
.
.
.
.

.
.

 M '( n / 2)( n / 2 - 1)  1, 2 M '( n / 2)( n / 2 - 1)  2, 2
...
...
.
.
.
.
...
...
.
.
.
.
...
M ' 1, 3
M ' 2, 3

 M '( n / 2)  1, 3
M '( n / 2)  2, 3

.
.
W ' 21  
.
.
.
.

.
.

 M '( n / 2)( n / 2 - 1)  1, 3 M '( n / 2)( n / 2 - 1)  2, 3
...
M ' 1, 4
M ' 2, 4

 M '( n / 2)  1, 4
M '( n / 2)  2, 4

.
.
W ' 22  
.
.
.
.

.
.

 M '( n / 2)( n / 2 - 1)  1, 4 M '( n / 2)( n / 2 - 1)  2, 4
...
...
.
.
.
.
...
...
.
.
.
.
...
M ' n / 2, 1 
M ' n, 1 

.
.

.

.

2
M '( n / 2) , 1
M ' n / 2, 2 
M ' n, 2 

.
.

.

.

2
M '( n / 2) , 2 
M ' n / 2, 3 
M ' n, 3 

.
.

.

.

M '( n / 2) 2 , 3 
M ' n / 2, 4 
M ' n, 4 

.
.

.

.

M '( n / 2) 2 , 4 
.For the multi-resolution representation
system, W '11 is the approximation
sub-band of Haar DWT decomposition and
W '12 , W '21 , W '22 are the detail sub-bands.
Assemble these 4 sub-matrices and we
obtain an n×n matrix W which is the DWT
The elements of these sub-matrices are the
3
coefficients matrix.
M=
multiplication, the result has to be divided
by 4. This is the slight difference from the
procedure for forward DWT. The filter
coefficients matrix C is the same as that of
forward DWT.
2.2.4 Apply some Aij (i =1,2,3...n/2 ;
2.2 Inverse Haar DWT
2.2.1 Divide W (n×n wavelet coefficients
matrix) into four sub-matrices W '11 , W '12 ,
W '21 and W '22 (all 4 are (n/2) × (n/2)
matrices) as:
W ' 11
W 
W ' 21
1
( M ' × C). In addition to the matrix
4
W 1,1 W 1, 2 W 1,3 .... W 1, n 


W ' 12  W 2,1 W 2, 2 W 2,3 .... W 2, n 
.
.
.
. 
 .
W ' 22  
 .
.
.
.
. 
 .
.
.
.
. 


Wn ,1 Wn , 2 Wn ,3 .... Wn , n 
j=1,2,3…n/2) to represent the resulted M
matrix as follows:


A11   M 11 M 12 M 13 M 14 




2.2.2 Scan the elements of W '11 row by
A12   M 21 M 22 M 23 M 24 




row and store them in the first column of
.


M ' ; scan the elements of W '12 row by row




and store them in the second column of M ' .
.


Similarly, apply the same rearrangement
 A  M

1,( n / 2)  n / 2,1 M n / 2,2 M n / 2,3 M n / 2,4 
rd


process on W '21 and W '22 to get the 3


A21   M ( n / 2)1,1 M ( n / 2)1,2 M ( n / 2)1,3 M ( n / 2) 1,4  
column and 4th column of M ' respectively.



The resulted M ' ((n/2)2 × 4 matrix) is

M 
.
denoted as follows:




.




 W 1 , 1 W 1n , (  / 2 ) 1W n  ( / 2 ) W1 n, 1  n ( /2 ) 1 , ( / 2 ) 1 A 2,( n / 2)   M n,1 M n,2 M n,3 M n,4 




 W 1 , 2 W 1n , (  / 2 ) 2W n  ( / 2 ) W1 n, 2  n ( / 2 ) 1 , ( / 2 ) 2




.


 .

.
.
.




.
.
.
 .



.
 W 1 ,n / 2
W n1 ,
W n (  / 2 n) 1 , / W
2 n
( n / 2 ) 1 ,






W
2
,
1
W
2
n
,
(

/
2
)
1
W
n

(
/
2
)
2
W
,
1
n

(
/
2
)
2
,
1


.


 .

.
.
.




 A( n / 2),( n / 2)   M ( n / 2) 2 4,1 M ( n / 2) 2 4,2 M ( n / 2) 2 4,3 M ( n / 2) 2 4,4  
M ' .
.
.
.
.
 W 2 ,n / 2
W n2 ,

 .
.

.
 .
 Wn / 2, 1 Wn / 2, ( n / 2)  1

.
 .
 .
.

Wn / 2, n
Wn / 2, n / 2
W
n (  / 2 )n
2,
W
/ 2
n
.
.
.
Wn, 1
.
Wn, ( n / 2)  1
.
.
.
.
Wn, n
Wn, n / 2











( n/ 2 )
2,
, where Mij are the matrix elements of M.
2.2.5 Transform each Aij into a Bij by inverse
procedure defined in 2.1.2. For example,
 M M12 
A11   M11 M12 M13 M14   B11   11

 M13 M14 
Then we rearrange all the sub-blocks Bij to
form N which is the result of inverse Haar
DWT.
2.2.3 Compute the intermediate matrix M
((n/2)2×4 matrix )by matrix multiplication:
4
matrix W of size (n/2) × (n/2). This
3 The k-level 2-D Haar DWT
The matrix algorithm is suitable for
computing the k-level DWT as well. We list
the procedures in the following sub-sections.
size-reduced W is the 2-level Haar DWT
coefficients matrix. Specifically to say , the
4 sub-matrices W '11 , W '12 , W '21 , and
W '22 are also size reduced ((n/4)×(n/4)) and
3.1 2-level 2-D Haar DWT
3.1.1 As stated above in 2.1, we have the
original
image
data
matrix
Nnxn,
i
n=2 ,i=1,2,3….
The filter coefficients matrix is still the
same:
C=
have the following multi-resolution meaning:
W '11 is the approximation sub-band of
2-level Haar DWT decomposition and W '12 ,
W '21 , W '22 are the detail sub-bands.
3.2 k-level 2-D Haar DWT
3.2.1 Define the original image Nnxn,
n=2i,i=1,2,3….
The filter coefficients matrix is still the
same:
1
1
1 1
1  1 1  1


1 1  1  1


1  1  1 1 
3.1.2 Apply some sub-blocks Bij (2×2 matrix)
to express the original image N as follows:
 N 11 N 12
 N 13 N 14
B11  
B12  


N
21
N
22


 N 23 N 24
 N 31 N 32
 N 33 N 34
B 21  
B 22  


N
41
N
42


 N 43 N 44
.
.
.
.
.
.
 Nn  1,1 Nn  1,2
 Nn  1,3 Nn  1,4
Bn / 2,1  
 Bn / 2,2   Nn ,3 Nn ,4 
 Nn ,1 Nn ,2 


...
...
.
.
.
...
C=
 N 1, n  1 N 1, n 
B1, n / 2  

 N 2, n  1 N 2, n 
 N 3, n  1 N 3, n 
B 2, n / 2  

 N 4, n  1 N 4, n 
.
.
.
 Nn  1, n  1 Nn  1, n 
Bn / 2 , n / 2  

 Nn , n  1 Nn , n 
, where Nij are the matrix elements of N.
3.1.3 Calculate N' ij = sum of the elements
in Bij and define a new (n/2)×(n/2) matrix
N ' as follows:
1
1
1 1
1  1 1  1


1 1  1  1


1  1  1 1 
3.2.2 For k-level Haar DWT, we choose Bij
of size 2k-1 × 2k-1 to express the image
matrix N.
 B1,1

 B2,1
N  .
 .

 Bn / 2k 1 ,1
B1,2
B2,2
.
.
Bn / 2k 1 ,2
B1,n / 2k 1 

.....
B2,n / 2k 1 

.
.

.
.

..... Bn / 2k 1 ,n / 2k 1 
.....
3.2.3 Compute N' ij = sum of the elements
N ' 1, 2 ..... N ' 1, n / 2 
 N ' 1, 1
 N ' 2, 1
N ' 2, 1 ..... N ' 2, n / 2 


.
.
.
N' .
.
.
.
 .

.
.
.
 .

 N ' n / 2, 1 N ' n / 2, 1 ..... N ' n / 2, n / 2 


in Bij and form a size reduced matrix N ' .
N '1, 2 ..... N '1, n / 2 k 1 
 N '1,1
 N '2,1
N '2,1 ..... N '2, n / 2 k 1 


.
.
.
.

N' 


.
.
.
.


.
.
.
.


k 1
k 1
k 1
k 1
 N ' n / 2 ,1 N ' n / 2 ,1..... N ' n / 2 , n / 2 
3.1.4 The following procedures are all the
same as those we stated in section 2.1.2 to
2.1.5. The only difference is the size of
original image data is now reduced to (n/2)×
N ' is of size (n/2k-1)×(n/2k-1).
3.2.4 The following procedures are all the
same as those we stated in section 2.1.2 to
2.1.5. The only difference is the size of
original image data is now reduced to (n/2k-1)
(n/2) and denoted as N ' . Thus, we can
eventually obtain a wavelet coefficients
5
80 70
B11  
  A11  80 70 5 15
 5 15 
Then we compose the intermediate matrix M
((n/2)2×4 matrix) with these Aij:
×(n/2k-1) and denoted as N ' . Thus, we can
eventually obtain a wavelet coefficients
matrix W of size (n/2k-1) × (n/2k-1). This
size-reduced W is the k-level Haar DWT
coefficients matrix. The 4 sub-matrices
W '11 , W '12 , W '21 and W '22 are now of size
(n/2k)×(n/2k) and have the same meaning
 A11

 A12
 A13

 A14
A
 21
 A22
A
 23
A
M   24
 A31
 A32

 A33
 A34

 A41
A
 42
 A43
A
 44
(for a multi-resolution system) stated in
3.1.4.
4 A Numerical Example
Let us introduce a numerical example to
illustrate the matrix algorithm so as to
provide a clear concept.
4.1 The basic matrix algorithm
4.1.1 Assume the original image data is
 80 70 60 50 40 30 20 10 
 5 15 25 35 45 55 65 75


100 90 80 70 60 50 40 30

.
160 140 120 100 80 60 40 20

N 
 87 77 67 57 47 37 27 17 


 4 8 12 16 20 24 28 32
 40 35 30 25 20 15 10 5 


 10 20 30 40 50 60 70 80







80
 60
 40
 20
100
80
 60
 40
87
 67
 47
 27
 40
30
 20
10
70
5
15 

50 25
35 
30 45
55 

10 65
75 
90 160 140 

70 120 100
50 80
60 

30 40
20 

77
4
8 
57 12
16 

37 20
24 
17 28
32 

35 10
20 
25 30
40 

15 50
60 
5
70
80 
4.1.4 Compute the 16 × 4 matrix M ' by
matrix multiplication. M ' = M × C












M '












The filter coefficients matrix is
C=









1
1
1 1
1  1 1  1 .


1 1  1  1


1  1  1 1 
4.1.2 Apply some sub-blocks Bij (2×2 matrix)
to express the original image N as follows:

80 70
60 50
40 30
20 10 
B12  
B13  
B14  
 B11  




 5 15
25 35
45 55
65 75 

100
90
80
70
60
50
40
30









 B 21  160 140 B 22  120 100 B 23  80 60 B 24  40 20 








N 
87 77
67 57
47 37
27 17 

 B 31   4 8  B 32  12 16  B 33  20 24 B 34  28 32









 B 41  40 35 B 42  30 25 B 43  20 15 B 44  10 5  
10 20
30 40
50 60
70 80 










170
170
0
0
130
50
170
170
0
0
30
110
490
30
110
370
250
30
30
70
30
130
176
30
6
10
152
152
128
6
6
96
40
104
105
6
5
16
45
125
145
5
5
15
75
165
5
135
20 
20 

20 

20 
10 

10 
10 

10 
14 

14 

14 
14 

15 
15 

15 

15 
4.1.5 We define an 8×8 matrix W and divide
it into four sub-matrices W '11 , W '12 , W '21
and W '22 (all 4 are 4 × 4 matrices). The
matrix W then looks like :
4.1.3 Transform each Bij into an Aij (1×4
matrix) by Z-scan data rearrangement. For
example,
W '11
W  W
 '21
W '12
W '22
Then we take the first column of M ' and
6
fill the elements in W '11 row by row; take
the second column of M ' and fill the
elements in W '12 row by row;take the third
W ' 11 W ' 12 
W 

W ' 21 W ' 22 
column of M ' and fill the elements in
W '21 row by row ; take the fourth column of
M ' and fill the elements in W '22 row by
row. As a result, we obtain the 4
sub-matrices as follows:
170
 490
W ' 11  
176

105
30
30
40
15
75
170
170

170

170
 490

 370
 250

130
M '
176

152

128
104

105
125

145
165

110 
10 
16 

135
 20 20 20 20 
 10 10 10 10 

W ' 22  
 14 14 14 14 


 15 15 15 15 
Hence, the DWT coefficients matrix W can
be assembled as:
W ' 11
W 
W ' 21
 170
 490
W ' 12  
  176
W ' 22  
 105
 130

110
 152

 45
0 
30 
6 

165 5 5 5 5 
110 20 20 20 20 

10 10 10 10 10 
16 14 14 14 14 

135 15 15 15 15 
170 170 170
0
0
0
370 250 130
152 128 104
30
6
30
6
30
6
125 145
50 30
70 30
96 40
15 75
170
170
0
0
0
370
152
250
128
130
104
30
6
30
6
30
6
125
50
145 165
30 110
5
20
5
20
5
20
70
96
15
30 10 10
40 16 14
75 135 15
10
14
15
10
14
15
0 
30 
6 

5 
20 

10 
14 

15 
process on W '21 and W '22 to get the 3rd
column and 4th column of M ' respectively.
Thus, we obtain matrix M ' .
0 0 0 0
 30 30 30 30 

W ' 12  
6 6 6 6


 5 5 5 5
50
70
96
170
4.2.2 Scan the elements of W '11 row by
row and store them in the first column of
M ' ; scan the elements of W '12 row by row
and store them in the second column of M ' .
Similarly, apply the same rearrangement
170 170 170 
370 250 130 
152 128 104 

125 145 165 
 130
 110
W ' 21  
 152

 45
 170
 490

 176

 105
 130

 110
 152

 45
0
0
130
50
0
0
30
110
30
110
30
30
70
30
30
6
10
152
6
6
96
40
6
5
16
45
5
5
15
75
5
135
20 
20 
20 

20 
10 

10 
10 

10 
14 

14 

14 
14 

15 
15 

15 
15 
4.2.3 Compute the intermediate matrix M by
matrix multiplication: M =
1
( M ' × C).
4
4.2.4 Apply some Aij (i =1,2,3,4;j=1,2,3,4)
to represent the resulted M matrix as
follows:
4.2 The matrix algorithm for Inverse Haar
DWT
4.2.1 We choose an 8×8 wavelet coefficients
matrix W and divide it into four
sub-matrices W '11 , W '12 , W '21 and W '22
(all 4 are 4×4 matrices).
7
 A11

 A12
 A13

 A14
A
 21
 A22
A
 23
A
M   24
 A31
 A32

 A33
 A34

 A41
A
 42
 A43
A
 44
















80
 60
 40
 20
100
80
 60
 40
87
 67
 47
 27
 40
30
 20
10
70
5
15 

50 25
35 
30 45
55 

10 65
75 
90 160 140 

70 120 100
50 80
60 

30 40
20 

77
4
8 
57 12
16 

37 20
24 
17 28
32 

35 10
20 
25 30
40 

15 50
60 
5
70
80 
C=
1
1
1 1
1  1 1  1


1 1  1  1


1  1  1 1 
4.3.2 Divide N into some sub-blocks as
follows:

80 70
60 50
40 30
20 10 
B12  
B13  
B14  
 B11  




 5 15
25 35
45 55
65 75 

100
90
80
70
60
50
40
30









 B 21  160 140 B 22  120 100 B 23  80 60 B 24  40 20 








N 
87 77
67 57
47 37
27 17 

 B 31   4 8  B 32  12 16  B 33  20 24 B 34  28 32









 B 41  40 35 B 42  30 25 B 43  20 15 B 44  10 5  
10 20
30 40
50 60
70 80 










4.3.3 Compute N' ij = sum of the elements
in Bij and form the size reduced matrix N ' .
170 170 170 170
N ' = 490 370 250 130
176 152 128 104


105 125 145 165
4.2.5 Transform each Aij into a Bij by inverse
procedure defined in 2.1.2. For example,
80 70
B11  
  A11  80 70 5 15
 5 15 
In this example, N ' is a 4×4 matrix.
Then we assemble all sub-blocks Bij to form
N.
4.3.4 Divide N ' into some sub-blocks as
follows:

80 70
60 50
40 30
20 10 
 B11  
 B12  25 35 B13  45 55 B14  65 75 
5
15









100 90 
 80 70 
60 50
40 30 

B
21 
B
22 
B
23 
B
24 
160 140
120 100
80 60
40 20 









N 
87 77
67 57
47 37
27 17 

 B 31   4 8  B 32  12 16  B 33  20 24 B 34  28 32









 B 41  40 35 B 42  30 25 B 43  20 15 B 44  10 5  
10 20
30 40
50 60
70 80 











170 170 
170
B'12  
370
250
176
152


128

 B'21  105 125 B'22  145




N ' =  B'11  490
4.3.5 Transform each B' ij into an Aij (1x4
matrix) by Z-scan rearrangement. For
example,
4.3 The matrix algorithm for 2-level Haar
DWT
170 170 
B ' 11  
  A11  170 170
 490 370 
4.3.1 We apply the same original image
data:
 80 70 60 50 40
 5 15 25 35 45

100 90 80 70 60

160 140 120 100 80
N 
 87 77 67 57 47

8 12 16 20
 4
 40 35 30 25 20

 10 20 30 40 50
30
20
55
50
65
40
60
37
40
27
24
15
60
28
10
70
170

130
104 
165 
490
370
Use these Aij to form the intermediate matrix
M (4x4) as follow:
10 
75 
30 

20 
17 

32 
5 

80 
 A11  [170
 A12  [170
M 
 A21  [176

 A22  [105
170 490 370]
170 250 130] 
152 128 104] 

125 145 165] 
4.3.6
Compute
multiplication:
M '  M C
Of course, the filter coefficients matrix is
still the same.
8
M'
by
matrix
also suitable for k-level DWT and the
1200 120 520 120
 720 120 40 120

M '
 558 4
98
44 


 542 4 78 44 
computation is quite straightforward. Unlike
the traditional approach, we do not need to
compute the lower level DWT coefficients
in advance. Therefore, it provides an
efficient approach for establishing a
multi-resolution representation system.
Furthermore, in the proposed algorithm, the
computational process and the original
image data are independent. Thus, it is very
convenient to improve the system speed
4.3.7 Then we take the first column of M '
and fill the elements in W '11 row by row,
take the second column of M ' and fill the
elements in W '12 row by row and so on. As
a result, we obtain 4 sub-matrices as
follows:
120 120 
1200 720 
W '11  
 W '12   4
4 

 558 542 
 520
W '21  
 98
40 
 120
W '22  
78
 44
performance by exploiting appropriate
parallel/pipeline methods. Even though the
original image data must be rearranged
before applying the matrix multiplication, it
takes only some placing and routing when
implemented with FPGA or ASIC. The
resulted extra delay should not be significant
and the overall performance must be much
better than the traditional approach.
120
44 
Assemble these 4 sub-matrices and we have
the 2-level Haar DWT coefficients matrix W
ready.
1200 720 120 120 

4 
W ' W '12   558 542 4
W   11


W '21 W '22   520 40 120 120 


44 
 98 78 44
4.4 k-level Haar DWT
The procedures are similar to those
described in section 4.3 and hence omitted
here.
5 Conclusion
Haar DWT is an efficient tool for image
processing, especially in multi-resolution
representation systems. However, the
6 Comments
In this report, we had presented a new
algorithm
for
Haar
DWT
and
Haar-wavelet-based multiresolution. This
algorithm can finish 2-D Haar DWT and
fully scaled multi-resolution system by one
multiplication. The key importance of this
algorithm is that the computational process
and the original image data are independent.
traditional method for 2-D DWT is a
computational intensive process and cannot
meet the speed requirement for many
real-time applications when implemented in
a general purpose computing system. It is
essential to develop new computing methods
for 2-D DWT. In this paper, we proposed the
matrix algorithm for both forward and
inverse Haar DWT. The matrix algorithm is
Based on this characteristic, we can use the
parallel method to improve the system
performance. Compared with traditional
method for Haar DWT, our algorithm have
good performance when implemented for
real-time system. This paper had been
accepted in Computer Graphics Workshop
2002 held in National Cheng Kung
University on 26-27 June 2002.
9
Reference
[1] S.G. Mallat, “A Theory for
Multiresolution Signal Decomposition: The
Wavelet Representation, ” IEEE Trans. On
PAMI, Vol. 11, No. 7, pp. 674-693, July
1989.
[2] M. Antonini, M. Barlaud, P. Mathieu and
I Daubechies, “Image Coding Using Wavelet
Transform, ” IEEE Trans on Image
Processing, Vol. 1, No. 2,April 1992.
[3] Masafumi Fujii, Wolfgang J. R. Hoefer,
“Filed-Singularity Correction in 2-D
Time-Domain Haar-Wavelet Modeling of
Waveguide Components” IEEE Trans on
Microwave Theory and Techniques, Vol.49,
No. 4,April 2001.
[4] Falkowski, B.J.” Forward and inverse
transformations between Haar wavelet and
arithmetic functions,” Electronics Letters,
Volume: 34 Issue: 11, 28 May 1998 Page(s):
1084 –1085
[5] Falkowski, B.J. “Relationship between
arithmetic and Haar wavelet transforms in
the form of layered Kronecker matrices”
Electronics Letters, Volume: 35 Issue: 10, 13
May 1999 Page(s): 799 –800
10
Download