You are on page 1of 6

Journal of Applied Computer Science & Mathematics, no.

11 (5) /2011, Suceava

Image Compression Based On Wavelet, Polynomial and Quadtree


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

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

15
Computer Science Section

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 JPEG.
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. Fig.2 The Band Encoder

II. THE PROPOSED SYSTEM Step3: pass the Y and the down sampled ( V ′ and U ′ ) de-
correlated color space to the wavelet encoder to produce the
The main concerns in the proposed system: compressed data which contains (Overhead Data, Polynomial
ƒ Get the benefit of energy compaction property of Bio- Coefficients, QuadTree Sequence and Shift Code Word). The
orthogonal tap 9-7 wavelet transform [3]. layout of the encoder is illustrated in Fig.2.
ƒ Since the approximation band contains low variation part The ' band encoder ' consists of the following steps:
of the signal, so, the use of polynomial transform will be Step1: perform tap 9-7 wavelet filters on Y and the down
helpful to approximate a significant energy part of LL sampled V ′ , U ′ chromatic bands. The transform will
band, and the approximation error is handled as a residue; decompose band data to the known subbands (LL, LH, HL,
it could be represented using quadtree as spatial encoder. HH).
The polynomial will prune the smooth part of the image Step2: partition the LL Subband into blocks each of size
signal. (4x4) pixels, and performs the polynomial approximation to
ƒ Shift coding optimizer is used as entropy encoder to the LL band blocks according to Equations (1,2,3,4). Then
minimize the bits required to represent the values of the subtract the LL coefficient value from the corresponding
produced codeword. Shift coding is adopted because it values generated by the polynomial representation; to
needs a little amount of over head information. produce the residue component. For polynomial
As described in Fig.1 the system layout is explained in the approximation the following equations were used to compute
following steps: the optimal values of polynomial coefficients:
Step1: reduce the redundancy between color component (R,
G, B) by transforming them into less correlated color space y = L −1 x = L −1

components (like YUV). ∑ ∑ G ( x, y )


y =0 x =0
Step2: Down sample the chrominance component (U, V) by 2 a0 = (1)
L2
y = L −1 y = L −1

∑ ∑ ( x − x ) × G ( x, y )
y =0 x =0
c

a1 = y = L −1 y = L −1
(2)
∑ ∑ (x − x )
y =0 x =0
c
2

y = L −1 y = L −1

∑ ∑ ( y − y ) × G ( x, y )
y =0 x=0
c

a2 = y = L −1 y = L −1
(3)
∑ ∑ (y − y )
y =0 x =0
c
2

Fig.1 The Compression System Layout

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

where, G(x,y) : is the original image elements values for each mapping, it is clear that the histogram has long tails due
(4x4) blocks and L is the width and height of the block. to the existence of a little bit of large element values.
L −1
X c = Yc = (4)
2
To gain a compression gain, the determined polynomial
coefficients are quantized using uniform scalar quantization
⎛a ⎞
b0 = round ⎜ 0 ⎟ → a0 = b0 × q0 (5)
⎝ q0 ⎠
⎛a ⎞
b1 = round ⎜ 1 ⎟ → a1 = b1 × q1 (6)
⎝ q1 ⎠
⎛a ⎞
b2 = round ⎜ 2 ⎟ → a2 = b2 × q2 (7)
⎝ q2 ⎠
Where q0, 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:
R ( x, y ) = G ( x -y ) − a0 − a1 ( x − xc ) − a 2 ( y − yc ) ∀ x,y (8)
where R(x,y) is the residue value at (x,y).
Step3: applying uniform quantization to quantize the residue Fig.3 The Entropy Encoder
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 Fig. 4: The histogram of the original buffer values
saved in the temporary buffer. To obtain high compression
This existence of such long tail causes a decrease in
gain the following steps are applied:
attained compression gain. In order to handle this problem
1. Map to positive: to avoid coding complexity due to
the histogram was packed to include only the elements
existence of positive/negative values the values of buffer
values have non-zero frequency of occurrences. This
elements are mapped to always positive, by applying the
histogram packing process is implemented using the
following:
if X i ≥ 0 ⎫
following algorithm:
⎧ 2X (9)
Xi = ⎨ i ⎬ L=-1
⎩ −2 X i − 1 if X i < 0⎭
For i= 0 to All Histogram Elements
where Xi is the ith element value registered in the buffer. { if His(i) > 0 then
According to the above equation all negative values are { Seq(i):=1; L+ +
mapped to be odd while the positive values will be nHis(L)= His(i): Tbl(i)=L
even. }
2. Calculate the histogram of the mapped elements Else Seq(i)=0
values. Fig.4 shows the histogram for the original }
elements value (i.e. before mapping). While Fig.5 where L is the length of the packed histogram, nHis is the
shows the histogram of the buffer elements after histogram array (after packing), Tbl(i) is a lookup table used
to map to positive elements values to packed positive values

17
Computer Science Section

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 (nS) and
long (nL) codewords the following steps are used
1) Set n L = ⎡log 2 (L )⎤ , where ⎡x ⎤ means the
Fig.5 The histogram of the buffer values after converging them to positive

smallest integer value higher than x.


2) For n that leads to lowest possible values
for NT, where
L L
nT = ∑ n His(i ) + ∑n L His(i )
i =0 n
i = 2 −1
3) set nS=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


Fig.6 The compressed histogram
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 q1 is the quantization step
applied of the LL-residue component, q2 is the quantization
step applied on LH,HL bands ; while the quantization step of
the HH band is set to (2q2). 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 (q1=5 and
q2 ∈ {20 − 30} ) 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, q1=7, q2=25, qpoly=1). The bits share used to encode
the wavelet bands is (%78.9). Fig.7 The Decompressed System Layout

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

TABLE 2:COMPARISSION BETWEEN THE MSE,PSNR


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

pq0=1, pq1=2 pq0=1, pq1=3


Quantization
steps

Lena Peppers

PSNR

PSNR
Cases

MSR

MSR
CR

CR
a 54.74 30.75 9.1305 54.72 30.74 9.2578
PSNR

PSNR
MSR

MSR

cases
CR

CR
q1 q2 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

Lena
2 20.05 35.11 3.47 20.42 35.03 3.55 d 59.5 30.39 12.08 59.68 30.37 12.057
5 24.57 34.23 4.6 24.42 34.25 4.71 e 53.07 30.88 11.697 53.39 30.85 11.675
10 34.57 32.74 6.19 32.35 33.03 6.21 f 55.22 30.71 12.317 55.72 30.67 12.297
2 15 41.02 32 7.55 38.42 32.29 7.5
a 49.83 31.16 8.8895 49.79 31.15 8.94
20 46.29 31.48 8.41 42.74 31.82 8.1
b 51.07 31.05 9.9312 51.12 31.04 9.9468

Peppers
30 54.73 30.75 9.07 49.89 31.15 8.8 a
c 52.69 30.91 10.568 52.72 30.91 10.569
50 66.98 29.87 9.96 61.46 30.24 9.37
d 54.69 30.75 11.433 54.9 30.73 11.237
2 21.3 34.85 3.64 21.63 34.78 3.68
e 49.69 31.17 11.12 49.95 31.14 10.768
5 25.79 34.02 4.9 25.6 34.05 4.94
f 52.4 30.94 11.647 52.72 30.91 11.664
10 35.81 32.59 6.75 33.53 32.88 6.63
3 15 42.23 31.87 8.4 39.63 32.15 8.11
TABLE3: NUMBER OF BYTES SPEND TO ENCODE
20 47.52 31.36 9.49 43.91 31.71 8.82 EACH BAND
30 55.95 30.65 10.3 51.04 31.05 9.66 b Lena case (f)
50 68.19 29.79 11.5 62.62 30.16 10.3 Bands
2 22.81 34.55 3.74 23.19 34.48 3.8 Y U V
5 27.31 33.77 5.08 27.17 33.79 5.15 b0 1408 170 187
Polynomial
b1 625 106 102
10 37.29 32.42 7.11 35.06 32.68 7.02 coefficients b2 765 138 122
4 15 43.76 31.72 8.96 41.19 31.98 8.7 Residue 6015 761 610
LH 2106 136 119
20 49.05 31.22 10.2 45.5 31.55 9.52 Wavelet Bands
HL 1360 66 30
30 57.48 30.54 11.2 52.64 30.92 10.5 c HH 2159 86 58
50 69.7 29.7 12.6 64.2 30.06 11.3 Total No. of bytes 14438 1463 1228
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 IV. CONCLUSIONS
10 39.08 32.21 7.45 37.04 32.44 7.3
5 15 45.55 31.55 9.5 43.13 31.78 9.14 From the test results of the proposed system, the following
20 50.82 31.07 10.9 47.39 31.37 10.1 remarks are stimulated:
30 59.24 30.4 12 54.56 30.76 11.2 d • If we take in consideration the preservation PSNR
50 71.48 29.59 13.7 66.08 29.93 12.1 level to be above the acceptable level. The best
2 26.45 33.91 3.92 27.29 33.77 3.97
attained compression is around (12).
5 30.96 33.22 5.42 31.3 33.18 5.48 • The bytes taken to encode wavelet bands and LL
10 40.97 32.01 7.77 39.24 32.19 7.64
residue component is many time higher than those
6 15 47.37 31.38 10 45.31 31.57 9.68
taken to encode polynomial coefficients.
20 52.62 30.92 11.6 49.65 31.17 10.7 e
• The increase in quantization step cause an increment
30 61.06 30.27 12.9 56.83 30.59 12
in the attend compression ratio and decrease the
50 73.32 29.48 14.8 68.38 29.78 13
PSNR value.
2 28.59 33.57 3.98 29.85 33.38 4.09
• The use of higher order of polynomial may be useful
5 33.09 32.93 5.53 33.88 32.83 5.7
to encode larger blocks and this may increase the
compression gain while preserving the image
10 43.09 31.79 8.02 41.78 31.92 8.08
quality.
7 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

50 75.46 29.35 15.7 70.95 29.62 14.4

19
Computer Science Section

REFERENCES University Beijing, 100871, China Department of Computer


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

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.

20

You might also like