Image Compression Based On Wavelet, Polynomial and Quadtree
Image Compression Based On Wavelet, Polynomial and Quadtree
Image Compression Based On Wavelet, Polynomial and Quadtree
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
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
∑ ∑ ( 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
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
18
Journal of Applied Computer Science & Mathematics, no. 11 (5) /2011, Suceava
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
19
Computer Science Section
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