You are on page 1of 6

Journal of Applied Computer Science & Mathematics, no.

11 (5) /2011, Suceava





15


Image Compression Based On Wavelet, Polynomial and Quadtree

1
Loay E.GEORGE,
2
Bushra A. SULTAN
Dept. of Computer Science, Baghdad University, Collage of Science, Baghdad, Iraq
1
louayedwar57@yahoo.com,
2
bushra542001@yahoo.com

AbstractIn this paper a simple and fast image compression
scheme is proposed, it is based on using wavelet transform to
decompose the image signal and then using polynomial
approximation to prune the smoothing component of the image
band. The architect of proposed coding scheme is high synthetic
where the error produced due to polynomial approximation in
addition to the detail sub-band data are coded using both
quantization and Quadtree spatial coding. As a last stage of the
encoding process shift encoding is used as a simple and efficient
entropy encoder to compress the outcomes of the previous stage.
The test results indicate that the proposed system can
produce a promising compression performance while preserving
the image quality level.

Keywords: image compression, compression algorithm,
Geometric Piecewise Polynomials.

I. INTRODUCTION

In recent years there is an explosion in the amount of
information available in the form of digital image data.
Though the storage/bandwidth constraints are surmounted to
a great extent an efficient image compression algorithm
always adds to overall system performance. The objective of
an image compression algorithm is to exploit the redundancy
in an image such that the smaller number of bits can be used
to represent the image while the remaining acceptable
visual quality for the decompressed image[1]. The trend in
image compression is increasingly wavelet-based due to the
fact that it provides high image quality at high compression
rate [2]. The main application of wavelet theory lies in the
design of filters for sub-band coding. It is a coding strategy
that tries to isolate different characteristic of a signal in a way
that collects the signal energy into few component. This is
refers to as energy compaction, its desirable because it is
easier to efficiently encode these component than the signal
itself [3].
A lot of wavelet compression algorithms were proposed in
the literature, including Embedded Zerotree Wavelet (EZW)
algorithm [4,5]. In fact EZW algorithm has been proposed by
Shapiro in 1993 and was the first efficient and elegant
subband coding algorithm by zerotree. On the other hand,
SPIHT is an improvement of EZW and has been proposed by
Said and Pearlman [6, 7]. Moreover, the Set Partitioned
Embedded Block coder (SPECK)[7,8] proposed by Pearlman
and al., uses wavelet packet transform, it is comparable to
SPIHT and uses the difference between the two methods
concerns mainly the partitioning of wavelet coefficients.
Quadtree coding has been one of the most popular
hierarchical segmentation based coding scheme investigated
by researchers [9]. It is recursively divides the image into
simple geometric regions. Hierarchical segmentation based
coding schemes (like, quadtree, HV) generally lead to
compression performance better than those based on fixed-
block partitioning (like, J PEG, subband coding, classical
vector quantization) [10].
Harby and Behery presented an image compression
algorithm based on dividing the original grey level image into
unoverlapped blocks depending on a threshold value. The
proposed algorithm is based on quadtree. It uses two stacks
instead of tree. The proposed algorithm stores the information
of all blocks, for instance the upper left coordinate, size,
minimum, and difference values in a stack, and the divided
blocks are numbered in effective way [11]. Hsin and Sung
proposed a method for rearranging the wavelet packet
coefficients of an image to form hierarchical trees, by which
the well known SPIHT algorithm can be applied. Their
proposed rearrangement scheme has been applied to the
highest frequency wavelet packet coefficients of images [12]
Many research efforts have spent to investigate the use of
different types of polynomial to represent the pictorial data,
and many of the efforts could be found in the literature. For
example, Schraringer [13] proposed the use of multi-
polynomial (spline) interpolation with wavelet texture coding
to build a robust lossy image compression method. J arwan
and Zemerly[14] used an adaptive variable degree chepyshev
polynomials (with variable length) to introduce a new lossy
image compression technique; their proposed compression
technique offers direct individual error control, where the
maximum error in gray level between the original and the
reconstructed images can be specified by the user. Kazinnik
et al [15] presented an image coding algorithm based on
Geometric Piecewise Polynomials (GPP) method. In this
algorithm the image repeatedly segmented, at the first (initial)
segmentation stage the minimization of the smoothness
criteria is the taken into account, then the initial segmentation
is pruned and the remaining curve portions are coded using
lossy compression methods. Muthaian et al [16] investigated
the compression performance of a technique based on using
cubic spline interpolation to reconstruct the image pixels
from a set of irregularly sample pixels (i.e., of the nyquist
rate) chosen randomly from the image. Krishnamoorthi and

Computer Science Section


16
Kannan [17] presented an image coding scheme based on
orthogonal polynomial. They proposed the use of different
polynomial bases operators (with different width) to represent
the image data, also they apply quantization and bit
allocation to encode the polynomial coefficients in a manner
similar to that used in J PEG.
In this paper a simple and fast hybrid method for
compressing color image based on wavelet transformation
and 2-D polynomial surface representation the letter is
utilized as a technique for reducing the large scale variation;
(or equivalently the low frequency component) associated
with the image signal. Both polynomial and wavelet
transform are combined in a high synthetic architect to
encode both the low and high frequency components,
respectively, in efficient way. The rest of the paper is
organized as follows. Section 2 contains the comprehensive
clarification of the proposed system. The result from the
proposed system is tested and discussed in Section 3 and
finally the conclusions are listed in section 4.

II. THE PROPOSED SYSTEM

The main concerns in the proposed system:
Get the benefit of energy compaction property of Bio-
orthogonal tap 9-7 wavelet transform [3].
Since the approximation band contains low variation part
of the signal, so, the use of polynomial transform will be
helpful to approximate a significant energy part of LL
band, and the approximation error is handled as a residue;
it could be represented using quadtree as spatial encoder.
The polynomial will prune the smooth part of the image
signal.
Shift coding optimizer is used as entropy encoder to
minimize the bits required to represent the values of the
produced codeword. Shift coding is adopted because it
needs a little amount of over head information.
As described in Fig.1 the system layout is explained in the
following steps:
Step1: reduce the redundancy between color component (R,
G, B) by transforming them into less correlated color space
components (like YUV).
Step2: Down sample the chrominance component (U, V) by 2

Fig.1 The Compression SystemLayout

Fig.2 The Band Encoder

Step3: pass the Y and the down sampled (V andU ) de-
correlated color space to the wavelet encoder to produce the
compressed data which contains (Overhead Data, Polynomial
Coefficients, QuadTree Sequence and Shift Code Word). The
layout of the encoder is illustrated in Fig.2.
The ' band encoder ' consists of the following steps:
Step1: perform tap 9-7 wavelet filters on Y and the down
sampled V , U chromatic bands. The transform will
decompose band data to the known subbands (LL, LH, HL,
HH).
Step2: partition the LL Subband into blocks each of size
(4x4) pixels, and performs the polynomial approximation to
the LL band blocks according to Equations (1,2,3,4). Then
subtract the LL coefficient value from the corresponding
values generated by the polynomial representation; to
produce the residue component. For polynomial
approximation the following equations were used to compute
the optimal values of polynomial coefficients:

( )
1 1
0 0
0 2
,

y L x L
y x
G x y
a
L
= =
= =
=

(1)
1 1
0 0
1 1 1
2
0 0
( ) ( , )
( )
y L y L
c
y x
y L y L
c
y x
x x G x y
a
x x
= =
= =
= =
= =

=



(2)
1 1
0 0
2 1 1
2
0 0
( ) ( , )
( )
y L y L
c
y x
y L y L
c
y x
y y G x y
a
y y
= =
= =
= =
= =

=



(3)


Journal of Applied Computer Science & Mathematics, no. 11 (5) /2011, Suceava



17
where, G(x,y) : is the original image elements values for each
(4x4) blocks and L is the width and height of the block.

1

2
c c
L
X Y

= = (4)
To gain a compression gain, the determined polynomial
coefficients are quantized using uniform scalar quantization
0
0 0 0 0
0

a
b round a b q
q

= =


(5)
1
1 1 1 1
1
a
b round a b q
q

= =


(6)

2
2 2 2 2
2

a
b round a b q
q

= =


(7)
Whereq
0
, q1, q2: are the polynomial quantization values.
For image quality preservation the error due to polynomial
approximation was not ignored; it is considered as residue
(R) and determined using the following equation:
( ) ( )
0 1 2
, - ( ) ( ) ,
c c
R x y G x y a a x x a y y x y = (8)
whereR(x,y) is the residue value at (x,y).
Step3: applying uniform quantization to quantize the residue
part and the detail subbands; where each component is
(LH, HL and HH), by divide by different quantization step
(q1, q2, q3, and q4 respectively).The quantization step values
depend on to the subjective significant of each wavelet band.
Step4: in this step any quantized subband is divided into 8x8
blocks; and a quadtree-based search to check the emptiness of
the tested block, if the block is not empty then the search
repeated on its four daughter quadrants (4x4 blocks).The
emptiness test is repeated for the daughter in hierarchal
manner produced quadrants; in this way till reaching
quadrants have size (2x2). The quadtree coding will be used
to address the empty blocks whether they have size 8x8, 4x4
or 2x2. For 2x2 non empty blocks their contents are saved in
a buffer beside to the quadtree coding sequence.
Step5: the entropy encoder (as explain in Fig.3 is used to
encode the content of nun empty (2x2) blocks, which are
saved in the temporary buffer. To obtain high compression
gain the following steps are applied:
1. Map to positive: to avoid coding complexity due to
existence of positive/negative values the values of buffer
elements are mapped to always positive, by applying the
following:
i i
i
2 0

2 1 0
i
i
X if X
X
X if X

=

<

(9)
where X
i
is the i
th
element value registered in the buffer.
According to the above equation all negative values are
mapped to be odd while the positive values will be
even.
2. Calculate the histogram of the mapped elements
values. Fig.4 shows the histogram for the original
elements value (i.e. before mapping). While Fig.5
shows the histogram of the buffer elements after
mapping, it is clear that the histogram has long tails due
to the existence of a little bit of large element values.

Fig.3 The Entropy Encoder


Fig. 4: The histogramof the original buffer values

This existence of such long tail causes a decrease in
attained compression gain. In order to handle this problem
the histogram was packed to include only the elements
values have non-zero frequency of occurrences. This
histogram packing process is implemented using the
following algorithm:
L=-1
For i=0 to All Histogram Elements
{ if His(i) >0 then
{ Seq(i):=1; L++
nHis(L)=His(i): Tbl(i)=L
}
Else Seq(i)=0
}
where L is the length of the packed histogram, nHis is the
histogram array (after packing), Tbl(i) is a lookup table used
to map to positive elements values to packed positive values

Computer Science Section


18
and Seq( ) is an array of bits required to make histogram un
packing process (in the decoding stage).
Fig.6 shows the histogram shape after packing process.

3. Map the buffer positive elements values to packed
values using the lookup table Tbl( ).
4. As a fined step, the shift-encoder was adopted as
entropy encoder due to:
a) Its ease of implementation in both encoding
and decoding stage.
b) The size of its corresponding over head
information is small (i.e., only two
numbers: the length of short and long
codewords in terse of bits).
To determine the optimal values of short (n
S
) and
long (n
L
) codewords the following steps are used
1) Set ( )

L n
L 2
log = , where

x means the
smallest integer value higher than x.
2) For n that leads to lowest possible values
for N
T
, where
( ) ( )

=
=
+ =
L
i
L
L
i
T
n
i His n i His n n
1 2
0


3) set n
S
=n

5. Save the output codewords in the binary stream of
the compression file.
To reconstruct the decompressed image all the above steps
will be reversed as explained in Fig.7.

III. TESTS REZULTS

Many sets of tests were conducted to access the
performance of the proposed compression scheme. As image
test samples Lena and Pepper image (with specifications:
size=256x256 pixel, pixel color depth=24 bit) have been
used. Table (1) lists the compression results for different
values of quantization step, where q
1
is the quantization step
applied of the LL-residue component, q
2
is the quantization
step applied on LH,HL bands ; while the quantization step of
the HH band is set to (2q
2
). The results listed in Table (1) are
obtained where the quantization steps for the polynomial
coefficients are set equal to 1. Table (2) shows the
corresponding results from some selected cases in Table (1)
which are marked by small letters, the quantization steps for
the polynomial coefficients are taken (2) and (3) in table 2.
The results in Table (1) shows that the set (q
1
=5 and
q
2 { } 30 20 ) lead to acceptable compression results in
terms of compression gain (CR) and fidelity measures
(PSNR). While the results in Table (2) shows that the
increase of the polynomial quantization steps lead to little
improvement in compression gain. Table (3) lists number of
bytes used to encode the compression output for case (Lena
image, q
1
=7, q
2
=25, q
poly
=1). The bits share used to encode
the wavelet bands is (%78.9).

Fig.5 The histogramof the buffer values after converging themto positive


Fig.6 The compressed histogram


Fig.7 The Decompressed SystemLayout

Journal of Applied Computer Science & Mathematics, no. 11 (5) /2011, Suceava



19
TABLE 1: COMPARISON BETWEEN THE MSE, PSNR AND THE CR
IN DIFFERENT VALUE OF QUANTIZATION STEPS.

Q
u
a
n
t
i
z
a
t
i
o
n

s
t
e
p
s

Lena Peppers

q1 q2
M
S
R

P
S
N
R

C
R

M
S
R

P
S
N
R

C
R

c
a
s
e
s

2 20.05 35.11 3.47 20.42 35.03 3.55
5 24.57 34.23 4.6 24.42 34.25 4.71
10 34.57 32.74 6.19 32.35 33.03 6.21
15 41.02 32 7.55 38.42 32.29 7.5
20 46.29 31.48 8.41 42.74 31.82 8.1

30 54.73 30.75 9.07 49.89 31.15 8.8 a
2
50 66.98 29.87 9.96 61.46 30.24 9.37
2 21.3 34.85 3.64 21.63 34.78 3.68
5 25.79 34.02 4.9 25.6 34.05 4.94
10 35.81 32.59 6.75 33.53 32.88 6.63
15 42.23 31.87 8.4 39.63 32.15 8.11
20 47.52 31.36 9.49 43.91 31.71 8.82

30 55.95 30.65 10.3 51.04 31.05 9.66 b
3
50 68.19 29.79 11.5 62.62 30.16 10.3
2 22.81 34.55 3.74 23.19 34.48 3.8
5 27.31 33.77 5.08 27.17 33.79 5.15
10 37.29 32.42 7.11 35.06 32.68 7.02
15 43.76 31.72 8.96 41.19 31.98 8.7
20 49.05 31.22 10.2 45.5 31.55 9.52

30 57.48 30.54 11.2 52.64 30.92 10.5 c
4
50 69.7 29.7 12.6 64.2 30.06 11.3
2 24.55 34.23 3.83 25.13 34.13 3.88
5 29.08 33.5 5.25 29.11 33.49 5.31
10 39.08 32.21 7.45 37.04 32.44 7.3
15 45.55 31.55 9.5 43.13 31.78 9.14
20 50.82 31.07 10.9 47.39 31.37 10.1

30 59.24 30.4 12 54.56 30.76 11.2 d
5
50 71.48 29.59 13.7 66.08 29.93 12.1
2 26.45 33.91 3.92 27.29 33.77 3.97
5 30.96 33.22 5.42 31.3 33.18 5.48
10 40.97 32.01 7.77 39.24 32.19 7.64
15 47.37 31.38 10 45.31 31.57 9.68

20 52.62 30.92 11.6 49.65 31.17 10.7 e
30 61.06 30.27 12.9 56.83 30.59 12
6
50 73.32 29.48 14.8 68.38 29.78 13
2 28.59 33.57 3.98 29.85 33.38 4.09
5 33.09 32.93 5.53 33.88 32.83 5.7
10 43.09 31.79 8.02 41.78 31.92 8.08
15 49.54 31.18 10.4 47.86 31.33 10.4

20 54.76 30.75 12.2 52.19 30.96 11.6 f
30 63.22 30.12 13.6 59.32 30.4 13.1
7
50 75.46 29.35 15.7 70.95 29.62 14.4




TABLE 2:COMPARISSION BETWEEN THE MSE,PSNR
AND THE CR FOR DIFFERENT VALUE OF POLYNOMIAL
COEFFICIENTS
pq
0
=1, pq
1
=2 pq
0
=1, pq
1
=3

C
a
s
e
s

M
S
R

P
S
N
R

C
R

M
S
R

P
S
N
R

C
R

a 54.74 30.75 9.1305 54.72 30.74 9.2578
b 55.99 30.65 10.384 56.03 30.64 10.399
c 57.57 30.53 11.189 57.63 30.52 11.388
d 59.5 30.39 12.08 59.68 30.37 12.057
e 53.07 30.88 11.697 53.39 30.85 11.675
L
e
n
a

f 55.22 30.71 12.317 55.72 30.67 12.297
a 49.83 31.16 8.8895 49.79 31.15 8.94
b 51.07 31.05 9.9312 51.12 31.04 9.9468
c 52.69 30.91 10.568 52.72 30.91 10.569
d 54.69 30.75 11.433 54.9 30.73 11.237
e 49.69 31.17 11.12 49.95 31.14 10.768
P
e
p
p
e
r
s

f 52.4 30.94 11.647 52.72 30.91 11.664

TABLE3: NUMBER OF BYTES SPEND TO ENCODE
EACH BAND

Lena case (f)

Bands

Y U V
b0 1408 170 187
b1 625 106 102
Polynomial
coefficients
b2 765 138 122
Residue 6015 761 610
LH 2106 136 119
HL 1360 66 30
Wavelet Bands
HH 2159 86 58
Total No. of bytes

14438 1463 1228

IV. CONCLUSIONS

From the test results of the proposed system, the following
remarks are stimulated:
If we take in consideration the preservation PSNR
level to be above the acceptable level. The best
attained compression is around (12).
The bytes taken to encode wavelet bands and LL
residue component is many time higher than those
taken to encode polynomial coefficients.
The increase in quantization step cause an increment
in the attend compression ratio and decrease the
PSNR value.
The use of higher order of polynomial may be useful
to encode larger blocks and this may increase the
compression gain while preserving the image
quality.

Computer Science Section


20
REFERENCES

[1] M. Santhi, R. S. D. Wahida Banu, Modified SPIHT Algorithm
for Coding Color Image using Inter-color Correlation
,IJ CSNS,VOL. 10 NO. 3, March 2010, pp.256.
[2] D. Dhouib, A. Nat-Ali, C. Olivier and M. S. Naceur,
Performance Evaluation of Wavelet Based Color on Brain MRI
Volumetric Medical Dataset for Storage and Wireless
Transmission, IJ BLS 3:3, 2007, pp. 147.
[3] B. Ramakrishnan and N. Sriraam, Optimal Wavelet
Decomposition for Wavelet Based Image Compression Coders:
An Empirical Study on Medical Images, Dept. of Biological
Eng., Maniple Institute of Technology, India,
rama_bala@ieee.org, 2002.
[4] J . M. Shapiro, Embedded Image Coding Using Zerotree
Wavelet Coefficients, IEEE Trans. Signal Processing , vol. 14,
pp. 3445-3462, 1993.
[5] K.R. Namuduri and V.N. Ramaswamy, Feature Preserving
Image Compression, Pattern Recognition Letters, Vol. 24, pp.
2767-2776, 2003.
[6] A. Said and W. Pearlman, A New fast and Efficient Image
Coder Based on Set Partitioning in Hierarchal Trees, IEEE
Trans. Circuit Syst. Video Technol., Vol. 6 , pp. 243-250, J une
1996.
[7] M. Penedo, W.A. Pearlman, P.G. Tahoces, M. Souto and J .J.
Vidal, Region-based Wavelet Coding Method for Digital
Mammography, IEEE Trans. Circuit on Medical Imaging, Vol.
22 ,No. 10, pp. 1288-1296, Oct. 2003.
[8] W.A. Pearlman, A. Islam, N. Nagaraj and A. Said, Efficient
Low-complexity Image Coding with Set-Partitioning Embedded
Block Coder, IEEE Trans. Circuit Syst. Video Technol., Vol.
14, No. 11 , pp. 1219-1235, Nov. 2004.
[9] Y. Chen, P. Hao, Integer Reversable Transformation to Make
J PEG Lossless , Center for Information Science, Peking
University Beijing, 100871, China Department of Computer
Science, ICSP04 Proceedings,2004.
[10] G.J . Sullivan and R. L. Baker ,Efficient Quadtree Coding of
Images and Vidio, IEEE Trans. Image Proce., Vol. 3,No. 3,PP.
327-331, May, 1994.
[11] A.A. El-Harby and G.M. Behery, "Qualitative Image
Compression Algorithm Relying on Quadtree", CGST-GVIP,
ISSN 1687-398X, Volume (8), Issue (III), October 2008.
[12] Hsi-Chin Hsin; Tze-Yun Sung, "An efficient rearrangement of
wavelet packet coefficients for embedded quad-tree image
coding", MUSP'07 Proceedings of the 7th WSEAS International
Conference on Multimedia Systems & Signal Processing, April-
2007.
[13] J . Scharinger, Image Compression by Multilevel Polynomial
Interpolation and Wavelet Texture Coding , Computer Aided
Systems Theory, EUROCAST97, Lecture Notes in Computer
Science, Vol. 133, PP. 429-443,1997.
[14] I. A. Al-J arwan and M. J. Zemerly, Image Compression Using
Adaptive Variable Degree Variable Segment Length Chebyshev
Polynomials, Image Analysis, Lecture Notes in Computer
Science, 2005, Vol. 3540, PP. 1196-1207, 2005.
[15] R. Kazinnik, S. Dekel , and N. Dyn, Low Bit-rate Image
Coding Using Adapive Geometric Pricewise Polynomial
Approximation , J ournal of Latex Class Files, Vol. 111, No. 22,
PP. 1-16,Nov. 2006.
[16] R. Muthaian, K. NeelaKantan, V. Sharma, and A. Arora, Image
Compression and Reconstruction Using Cubic Spline
Interpolation Technique, American J ournal of Applied
Sciences, Vol. 5, No. 11, PP. 1562-1565, Nov. ,2008.
[17] R. Krishmamoorthi and N. Kannan , A New Integer Image
Coding Technique Based on Orthogonal Polynomials, Image
and Vision Computer Archive, Vol. 27, Issue 8,PP. 999-1006,
J uly, 2009



Loay E.GEORGE had graduate from Baghdad University at 1979, got MSc. at 1982 and PhD at 1997 in digital image
processing. Now , he works in Computer Science Department/ Collage of Science/ University of Baghdad.

Bushra A. SULTAN had graduate from University of Technology at 1995, got MSc. at 2011. Now she works in Computer
Science Department/ Collage of Science/ University of Baghdad.

You might also like