The Use of Cubic Bezier Interpolation, Biorthogonal Wavelet and Quadtree Coding to Compress Color Images

This work was carried out in collaboration between all authors. All authors participated in designing, software developments, testing and evaluation of proposed system


INTRODUCTION
With the coming of internet, huge number of images is transmitted [1]. Uncompressed images can take a lot of memory in RAM and in storage media, and they can take more time to transfer from one device to another [2]. Thus Memory space and bandwidth limit are the real difficulties during image transmission [1]. Hence the fundamental aim of image compression is to decrease the storage space needed to store an image and to decrease the required time to transfer the image. Reduction in the size of image permits to proficiently use the memory or disk space [3].
During the last several years, wavelet transformations have achieved widespread acceptance, particularly within image compression research. Wavelets are also chosen as basic functions in JPEG 2000 [4], and one of the most imperative processing components of image compression is wavelet transform [5].
In this paper, CBI is applied on image to prune the large scale components of (Y,U,V) bands of image, then Biorthogonal Wavelet transform is applied on the residual component of Bezier image to transform the pixels in the uncompressed image into frequency domain coefficients (called transform coefficients). These coefficients have various desired properties. One is the energy compaction property that results in most of the energy of the uncompressed data being centered in only a little of the considerable transforms coefficients. This is the essential of achieving the compression [6].
In a wavelet compression system, the entire image is transformed and compressed as a single data object rather than block by block as in a DCT-based compression system. It allows uniform distribution of compression errors across the entire image [7], the resulting transform coefficients are quantized using uniform scalar quantization. Then, the quantized values are represented using quadtree encoding to prune the sparse blocks, followed by an improved shift coding algorithm.

PREVIOUS WORKS
1. Thanoon and George [8] have proposed a system utilizes 9/7 biorthogonal wavelet transforms, and then Discrete Cosine Transform (DCT) and quadtree coding are used to compress the approximate and detail subbands, respectively. A hierarchal quantization scheme was applied to reduce the number of bits required to encode the wavelet coefficients. Quadtree encoding was utilized as a further step to encode the quantized wavelet coefficients. The test results indicated that the proposed compression scheme shows good performance aspects.
2. Chen et al. [9] presented a near lossless medical image compression scheme based on combined JPEG-LS with cubic Spline interpolation (CSI). The CSI was developed to subsample image data with minimal distortion and to achieve image compression. The system led to high compression ratio and higher subjective quality when its results are compared with the outcomes of some standard transformbased codecs.
3. Muthaiah et al. [6] introduced a new dimension of image compression based on using random pixels of irregular sampling and image reconstruction that based on CSI techniques. The presented results showed the system can provide better efficiency both in pixel reconstruction and color reproduction.
4. George and Sultan [10] presented an image coding scheme based on wavelet transform, polynomial representation and quadtree coding. They proposed a scheme which uses the biorthogonal (tap 9/7) wavelet transform to decompose the image signal, and 2-D polynomial representation. Polynomials are utilized to prune the existing high scale variation of image signal. Also, they applied quantization with quadtree coding to compress the detail band and the residue part of approximation subband. Finally the results are further encoded using shift encoder as an efficient entropy encoder.

THE PROPOSED METHODOLOGY
The proposed system consists of the first four preprocessing stages; Description of these stages is explained in the following subsections (as shown in Fig. 1).

Image Data Loading
In this stage, the data of image file is loaded and, the loaded data is separated into three arrays (R, G, B) each holds the data of certain color components.

Image Partitioning
Expanding vertically and horizontally the three arrays (R, G, B), if it is needed, according to a predefined block size, so that the width and height values of the expanded image will be multiples of block size value.
Image horizontal expansion is needed if the image width (W) is not multiple of block length (L Block ). Also, in case the image height (H) is not multiples of block length (L Block ) then vertical expansion is needed to expand [12].
Image expanding is done by adding a number of columns or rows according to the values of image width & height and to the predefined value of block size. Fig. (2) presents an illustrative example, when the size of image is taken 8x8 and the block size is 3.
The number of required added columns (n column ) or rows (n row ) can be determined according the following steps: Where, N x is number of blocks aligned horizontally; N y is number of blocks aligned vertically; W' is the new width value; W' is the new width value.

Color Transform
In this stage the spectral redundancy is reduced by transforming the components (R, G, and B) into less correlated color space components (like YUV

Chrominance Band down Sampling
Since the chrominance components (U and V) holds only 10% of the whole image information, then these bands are down sampled by 2 to produce the down sampled components (U d & V d ). This down sampling will cause insignificant subjective distortions in the color image. In the conducted tests, this step was treated as optional (with and without) stage.

Cubic Bezier Interpolation
CBI is applied on each color sub-band (Y, U d , V d ), individually, to prune the large scale components of the image bands. It has been accomplished by partitioning each band into a non-overlapped blocks each has predefined length (L block x L block ) pixels. Then the following steps are applied: The establishment of cubic Bezier surface could accomplished by applying Bezier approximation twice times, the first is horizontal (i.e., establishing the Bezier curves passing through the centers of adjacent blocks aligned horizontally), and the second is vertical (i.e., establishing the Bezier curves passing through the corresponding vertically aligned points which belong to parallel adjacent Bezier curves. 3. After the construction of Bezier surface, then it is subtracted from the original color bands to compute the residue components (Yr, U dr & V dr ).

Wavelet Transform
In this step, the bio-orthogonal tap 9/7 wavelet filters are applied on residual parts of Y r , U dr and V dr in separated manners. The transform will decompose each residue color band data to the four known subbands (LL, LH, HL & HH). ]

Scalar Quantization
The progressive scalar quantization was adopted to quantize the coefficients on each wavelet (detail) subbands individually. This step is to reduce the range wavelet coefficients values without making significant subjective distortions in image quality. The reduction in the dynamic values of wavelet coefficient will, consequently, reduce the number of bits needed to represent the coefficients values. The hierarchal scalar quantization process is applied to quantize the coefficients of each subband according to the following equation:

Quadtree Coding
In this step, the process of quadtree coding is applied to encode the quantized detail bands (i.e., LH, HL & HH) subbands of (Y r , U dr , V dr ). The quadtree method divides a square subband into four equal sized square blocks, and then tests each block to see if meets emptiness criterion [14], in case the tested block is not empty then the search is repeated upon its four daughter quadrants (4x4 blocks). This process repeated, recursively, starting from the whole image and continuing until reaching the smallest block size (i.e., 2x2 block). If it is a non-empty block, then its contents are saved in a buffer beside to the quadtree coding sequence.

Entropy Encoding
The final process of the proposed system is to compress the data of the non-empty quadtree blocks, which are saved in Seq() buffer. Fig. (3) presents the layout of developed entropy coder; which is designed to efficiently remove the statistical redundancy without significant time consuming and big overhead data.

Fig. 3. Entropy encoder
Entropy coding is required after the quad tree step, the produced sequence of coefficients are shift coded, usually the histogram of the incoming sequence shows sharp peak around zero value; this makes shift coding a suitable choice for entropy coding to achieve further compression gain. The introduced enhanced shift coding consists of the following steps:

A. Mapping to Positive
This step aims to convert all elements values of the incoming sequence to positive numbers. This step is useful to avoid coding complexity, due to existence of positive/ negative values, in the next coding steps, such that all negative values are mapped to be odd while the positive values will be even. The mapped elements are produced by applying the following equation:

B. Do Histogram Packing
Due to the long tails of the histogram of mapped elements values. This long tail is caused to the existence of large elements values, although it has very little probability of occurrence. This long tails cause a significant decrease in compression gain when entropy encoding is applied. Therefore, to address this problem a packing (i.e., shrinking) for the histogram is applied. This histogram packing task is accomplished by using the following algorithm:

For i= 0 to All Histogram Elements { if His(i) > 0 then { L+ +; MT(i)=1; pHis(L)= His(i); Tbl(i)=L; } Else MT(i)=0; }
Where, L is the length of packed histogram, pHis is the histogram array (after packing process), Tbl (i) is a lookup table used to map the positive elements values to packed positive values, and MT( ) is an array of bits, which is required to do the histogram stretching process (during the decompression stage).

D. Do Pairing Process
In this step, the most frequent pair of successive values is allocated, then they replaced by single value (i.e., Max+ 1; where M is the highest coefficient value before pairing). The pair replacement steps are the following: F. As final step, the shift-encoder is applied as entropy encoder due to the following reasons: i. Owing to its simplicity and efficiency in both encoding and decoding stage. ii. The size of its corresponding overhead information that needed for decompression process is small (i.e., only two numbers: the length of short and long codewords in terms of bits). iii. It is a simple type of variable length coding (VLC) schemes. In the VLC methods, short code words are assigned to symbols have higher probability. By this approach, compression efficiency is thus improved by exploiting statistical redundancies [15].
To determine the best two codewords lengths to encode the small and large values of sequence elements, respectively. The optimal values for these two codewords lengths should satisfy The values of n s & n l represent the length of short codewords and long codewords respectively, that leads to the minimum possible value for T Bits . The array His () represents the histogram array. After determining the proper values of n s & n l , then apply the traditional shift coding process to save the output codewords into the binary output file.
To reconstruct the decompressed image, all the encoding steps will be reversed as explained in Figs. (4 and 5).

RESULTS AND DISCUSSION
Many sets of tests have been conducted to assess the performance of the proposed image compression scheme in terms of Compression ratio (CR), Peak Signal to Noise ratio (PSNR), Encoding Time (ET), and Decoding Time (DT). The proposed image coding system was implemented using (C# programming language), is working under windows 7 Home premium, The tests have been conducted using laptop computer has processor: Intel ® Core ™ i3-2350M CPU@ 2.30 GHz, RAM: 4.00 GB, x32based processor. Several parameters were taken into consideration to study the performance of the suggested image compression system. The effects of the following control parameters have been investigated: (i) initial quantization step (Qs) for subbands coefficient (LH, HL, and HH), (ii) the descending rate parameter (α) (iii) Beta multiplication parameter (β), (iv) the block size (L block ), (v) the number of wavelet passes (N pass ). Table (1) shows the characteristics of the tested image samples. Table (2) presents the adopted default values of the considered control parameters. The effects of each parameter are explored by varying its value while setting other parameters fixed at their default values.     The efficiency performance of the proposed image coding methods is applied on Lena Image has been evaluated by making comparisons between them and corresponding compression results obtained by applying the compression standard JPEG in term of CR, PSNR ,as shown in Table (

CONCLUSION
In this paper, an image compression scheme based on using cubic Bezier interpolation, wavelet, Quadtree and high order shift coding had been introduced. The following remarks are stimulated: • The use of CBI had improved the compression performance (i.e., increase the compression gain while preserving the image quality). • The increase in quantization step causes an increase in compression ratio and a decrease in PSNR value. • As a future work the developed system can be improved by applying the first order polynomial on the small areas of residue component (i.e., after subtracting the cubic Bezier from the image). In order to prune the local smoothing components and getting better compression gain.