Compression of Image using Fibonacci Code(FC) in ...

6 downloads 0 Views 526KB Size Report
HOD, Department of Computer Science and Applications, Gandhigram Rural ..... Women's University, Kodaikannal, Tamil Nadu, India in the year 2003 and.
K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319

Compression of Image using Fibonacci Code(FC) in JPEG2000 K. SOMASUNDARAM1 HOD, Department of Computer Science and Applications, Gandhigram Rural Institute, Gandhigram, India [email protected]

P. SUMITRA2 Research Scholar, Department of Computer Science, Mother Teresa Women’s University, Kodaikannal, India [email protected] Abstract : JPEG2000 is a image-coding standard developed for compression of any image. JPEG 2000, which provides a higher compression ratio than the traditional JPEG, is an upcoming compression standard for still images. The JPEG2000’s algorithm is based on Discrete Wavelet Transform (DWT) and the Embedded Block Coding with Optimal Truncation (EBCOT). Both algorithms are computationally intensive and require significant memory. We propose a new coding with Fibonacci numbers to compress losslessly the scalar quantized and DWT coefficients. We present a coding scheme based on Fibonacci numbers in the place of EBCOT in JPEG2000. We prove that Fibonacci code gives better results. Keywords: JPEG2000; Embedded Block Coding with Optimal Truncation (EBCOT); Scalar Quantisation; Discrete Wavelet Transform (DWT); Fibonacci Code (FC). 1.

Introduction

The goal of an image compression method is to reduce the size of the file without degrading the quality of the image, much. Compressed images require less space for storage and require low bandwidth to transmit across internet [1]. The most common method used for compression is JPEG2000 [2] which make use of Discrete Wavelet Transform (DWT), quantization and Embedded Block Coding with Optimal Truncation (EBCOT). The purpose of having a new standard was twofold. First, it would address a number of weaknesses in the existing JPEG standard. Second, it would provide a number of new features not available in the JPEG standard. 1.1. Motivation Generally, the more contrast in an image, higher the quality the image needs to be saved to result in a decentlooking final image. This standard is intended to advance standardized image coding systems to serve applications into the next millennium. It will provide a set of features vital to many high-end and emerging image applications by taking advantage of new modern technologies. Specifically, this new standard will address areas where current standards fail to produce the best quality or performance including the following. It will also provide capabilities to markets that currently do not use compression especially low bit-rate compression performance, Lossless and lossy compression, Large images, Single decompression architecture, Transmission in noisy environments, Computer generated imagery and Compound documents. As JPEG2000 is the most commonly used compressor, we felt that improvements on this can lead to further reduction in bit rate and improve the image quality. This is the motivation for carrying out our research work on one of the layers of the JPEG2000 architecture. 1.2. Literature Survey Antonin et al[3] presented a hardware JPEG2000 decoder for real time applications. Zhen Liu et al[4] presented a new encoding approach to control the JPEG2000 encoding and achieved consistent quality images at a lower bit rate. Qian and Fowler [5] presented a Principal Component Analysis (PCA) in JPEG2000 and achieved simultaneous decorrelation as well as dimensionality reduction which offer the potential for excellent datacompression performance. Zahia et al[6] presented a novel selective encryption images schemes based on JPEG2000. Their algorithm works with any standard ciphers and introduces negligible computational cost. Diego et al[7] presented a novel data-hiding technique based on the Fibonacci representation of digital images.

ISSN: 0975-5462

7311

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 Their results show that, a redundant scheme outperforms the classical LSB method resulting in images having less perceptual distortion even if different planes from the lowest bit plane are selected for embedding. Aleksandra and Emina [8] presented a sampling scheme which provides a uniform quantization of the lab space based on Fibonacci numbers and spiral lattices. The sampling scheme is used to generate color palettes for color quantization, display and processing. In this paper we present a coding scheme based on Fibonacci numbers in the place of EBCOT in JPEG2000. The proposed method gives better PSNR values than EBCOT. The remaining part of the paper is organized as follows. In section 2 we explain the architecture of JPEG2000. Existing JPEG2000 with EBCOT are described in Section 3. The proposed JPEG2000 with Fibonacci code, a new method and Fibonacci code algorithm with examples are proposed in section 4. In section 5 the results and discussion are given. Finally we conclude in section 5. 2. Architecture of JPEG2000 For continuity we briefly explain JPEG2000. The JPEG2000 architecture is shown in Fig. 1.

A Discrete Wavelet Transform (DWT) is used to decompose each tile component into different subbands. The transform is in the form of dyadic decomposition and use bi-orthogonal wavelets. The representation of DWT with lena image is shown in Fig. 2.

After transformation, all coefficients are quantized using scalar quantization. Quantization allows greater compression to be achieved, by representing transform coefficients with only the minimal precision required to obtain the desired level of image quality. Quantization of transform coefficients is one of the two primary sources of information loss in the coding path and entropy coded, before forming the output codestream (bit stream). A different quantizer is employed for the coefficients of each subband and each quantizer have only one parameter, its step size. Mathematically, the quantization process is defined as (1) where Δ is the quantizer step size, U(x; y) is the input subband signal, and V(x; y) denotes the output quantizer indices for the subband. The coefficients in a code block are separated into bit-planes. Each of these coding passes collects contextual information about the bit-plane data. The contextual information along with the bit-planes are used by the arithmetic encoder to generate the compressed bit-stream. For each code-block, a separate bit-stream is generated. The coded data of each code-block is included in a packet. If more than one layer is used to encode

ISSN: 0975-5462

7312

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 the image information, the code-block bit-streams are distributed across different packets corresponding to different layers. Each layer consists of a number of consecutive bit-plane coding passes from each code-block in the tile, including all sub-bands of all components for that tile. Each subsequent layer is formed by optimally truncating the code-block bitstreams to achieve successively higher target bit-rates, distortion bounds or other quality metrics, as appropriate, and including the additional code words required to augment the information represented in previous layers to the new truncation points. By interleaving the packets in different orders, four possible progression orders mainly quality, resolution, spatial location and component can be achieved in JPEG2000. The coefficients of bitstream is transferred for decoding process. The bitstream is entropy decoded, dequantized and inverse discrete transformed, providing the reconstructed image data. In this way, we obtain the reconstructed quantizer indices for each subband. In the case of lossy coding, the reconstructed quantizer indices may only be approximations to the quantizer indices originally available at the encoder. In the lossless case, the reconstructed quantizer indices must be same as the original indices on the encoder side, since all coding passes must be included for lossless coding.

3.

Existing JPEG2000 with EBCOT

We are replacing Entropy Encoding with EBCOT. The compression engine of JPEG2000 with EBCOT consists of three parts. Discrete Wavelet Transform (DWT), the quantization and EBCOT. The block diagram of compression engine of JPEG2000 with EBCOT is shown in Fig. 3.

The DWT is first applied on the given source image. These decomposition levels contain a number of subbands that describe the horizontal and vertical spatial frequency characteristics of the original tile component planes. The DWT coefficients are further quantized using scalar quantization. Quantisation is the process by which the transform coefficients are reduced in precision. Each subband of the wavelet decomposition is divided up into rectangular blocks, called code-blocks, which are coded independently using arithmetic coding. This approach is called EBCOT. Such a partitioning reduces memory requirements in both hardware and software implementations and provides a certain degree of spatial random access to the bitstream. The block size is identical for all subbands, so that blocks in lower resolution subbands span a larger region in the original image. The DWT is first applied on the source image data. The resulting transform coefficients are then quantized before forming the output code stream (bit stream). The EBCOT algorithm is employed to compress the quantized DWT coefficients.

4. Proposed JPEG2000 with Fibonacci code The proposed method will be detailed as follows. 4.1) The Proposed Fibonacci method 4.2) Compression engine of JPEG2000 with Fibonacci code 4.1 The Proposed Fibonacci method We now present our method to compress the image. The Fibonacci code is based on the Fibonacci sequence. In Fibonacci sequence, the nth number is the sum of previous (n-1)th and (n-2)nd Fibonacci numbers. This sequence is given by [9]. F0 = 1 F1 = 1

(2)

Fi = Fi-1 + Fi-2, i ≥ 2

ISSN: 0975-5462

7313

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319

By Zeckendrof’s theorem [10], every positive integer n can be expressed as a sum of distinct nonconsecutive Fibonacci numbers. Since no consecutive 1’s appear in a Zeckendrof’s representation, bit 1 is appended to Zeckendrof’s binary representation. Thus two consecutive one’s (11) is used as a termination of Zeckendrof’s code. Fibonacci Coding (FC) makes use of this principle: Any positive integer N can be represented as:

(3) where Fi is the i-th Fibonacci number(1,1,2,3,5,8…), di Є{0,1} , dk=1[11]. Leaving the first Fibonacci number, the first 9 of the remaining numbers and their corresponding indices are : Fn

1, 2, 3, 5, 8, 13, 21, 34, 55

index

1 2 3 4 5

6

7

8 9 (4)

Example 1: Let N = 45 = 3 + 8 + 34 = F(3) + F(5) + F(8) Put 0 for the missing Fibonacci numbers = 0 0 F(3) 0 F(5) 0 0 F(8) =0 0 1 0 1 0 0 1 Append 1 =0 0 1 0 1 0 0 1 1 FC of 45

= 001010011

Example 2: Let N = 9 = 1 + 8 = F(1) + F(5) = 10001 Append 1 =100011 FC of 9 = 100011 Table 1 shows the FC for first 15 natural numbers. Table 1. FC for First 15 Fibonacci numbers

ISSN: 0975-5462

n

F(n)

Fibonacci Code

1 2 3 4 5 6 7 8

F(1) F(2) F(3) F(1) + F(3) F(4) F(1) + F(4) F(2) + F(4) F(5)

11 011 0011 1011 00011 10011 01011 000011

7314

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 9 10 11 12 13 14 15

F(1) + F(5) F(2) + F(5) F(3) + F(5) F(1) + F(3) + F(5) F(6) F(1) + F(6) F(2) + F(6)

100011 010011 001011 101011 0000011 1000011 0100011

4.2. Compression engine of JPEG2000 with Fibonacci Code In this paper we propose a new coding with Fibonacci numbers to compress losslessly the scalar quantized, DWT coefficients. The compression engine of JPEG2000 with Fibonacci code is shown in Fig. 4.

The DWT is first applied on the given source image. It decompose into number of subbands. The DWT coefficients are further quantized using scalar quantization. The Fibonacci code algorithm is employed to compress the quantized DWT coefficients. We propose a new method to compress the scalar quantized integers in the JPEG2000, using Fibonacci Coding. The integer numbers are represented using Zeckendorf’s theorem. 4.2.1 Encoding Algorithm to generate FC The following steps are used to encode the given N, to get FC: Step 1. Input N. Step 2. Set FC = 1. Step 3. Find a Fibonacci number Fn such that Fn ≤ N Step 4. Find N = N – Fn. Step 5. If Fn is the first number generated then prefix FC with 1. FC = 1 concat FC else find the distance d between the current Fn and the previous Fn+1. d = index(Fn+1) – index(Fn). Prefix FC with 1 followed by (d-1) zeros. FC = 1 zeros(d-1) FC Step 6. If N≠0, go step 3. Step 7. Find i = index of (Fn) if i=1 FC = FC else FC = zeros(i-1)FC

ISSN: 0975-5462

7315

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 Example Step 1. N = 45 Step 2. FC = 1 Step 3. Fn = 34 Step 4. N = 45 – 34 = 11 Step 5. Is Fn is the first Fn? Yes, FC = 11 Is N = 0? No Step 3. Fn = 8 Step 4. N = 11 – 8 = 3 Step 5. Is Fn is the first fibonacci ? No d = index(34) - index(8) = 8 - 5 = 3 FC = 10011 Step 3. Fn = 3 Step 4. N = 3 – 3 = 0 Step 5. Is Fn is the first fibonacci? No d = index(8) - index(3) = 5 - 3 = 2 FC = 1 0 1 0 0 1 1 Step 6. Is N = 0? Yes Step 7. i = index(3) =3 If i = 1? No FC = 0 0 1 0 1 0 0 1 1 4.2.2 Decoding Algorithm to generate FC To get the original N from Fibonacci Code(FC) the following steps are used. Step 1. Read the bit stream until two consecutive 1’s (11) appear. Step 2. Remove the right most 1. Step 3. Starting from left, find the location indices of 1’s appearing in the FC. Step 4. Find the Fibonacci numbers corresponding to those indices. Step 5. Reconstruct N using equation (2). Example: Decode: 001010 01 1 Step 1. FC = 0 0 1 0 1 0 0 1 1 Step 2. Remove right most ‘1’. Step 3. Indices of 1’s =3, 5, 8 Step 4. Find the Fibonacci numbers with indices 3, 5, 8. F(3) = 3 ; F(5) = 8; F(8) = 34 Step 5. N = 3 + 8 + 34 = 45 5. Results and Discussion We carried out experiments on standard images Lena, Barbara and Baboon, each of size 512 x 512 pixels. In each experiment, first the images are subjected to DWT followed by scalar quantization. The quantized numbers are then subjected to the FC to get the compressed image. Then decompression is done and the images were reconstructed and we computed the Peak Signal To Noise Ratio (PSNR) values for different band planes 0,

ISSN: 0975-5462

7316

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 15 and 30 for each of the three images. The results obtained by our FC, EBCOT, Teerapet and Jeerakit (TJ)[12] are given in Table 2, for Lena image, band plane 0 for different bit rates of 0.1 to 0.75 bits per pixel (bpp). We note from Table 2, that the proposed method gives better results than EBCOT and TJ for all bit rates. Table 3 shows the results for Lena image at bit plane15 and Table 4 for 30. The PSNR values increased for EBCOT, TJ and our method. In this case also, the PSNR values obtained by our method FC are better than the other methods. Experimental results showed similar results for lena image. Table 2. PSNR values for EBCOT, TJ and FC for different bpp and band planes 0 for Lena image Band Plane(0) bit per pixel PSNR Values EBCOT TJ[12] FC (proposed) 0.01 28.14 28.14 28.45 0.10 32.79 32.79 32.80 0.20 35.68 35.68 36.00 0.30 38.73 38.73 38.75 0.40 42.80 42.80 43.35 0.50 46.20 46.20 46.70 0.60 52.06 52.06 52.80 0.70 67.71 67.71 68.00 0.75 67.71 67.71 67.73 Table 3. PSNR values for EBCOT, TJ and FC for different bpp and band plane 15 for Lena image Band Plane(15) bit per pixel PSNR Values EBCOT TJ[12] FC (proposed) 0.01 28.30 28.30 28.45 0.10 32.89 32.89 33.90 0.20 35.88 35.88 36.20 0.30 39.48 39.48 39.67 0.40 43.12 43.12 43.75 0.50 47.25 47.25 48.00 0.60 52.06 52.06 52.09 0.70 67.71 67.71 67.71 0.75 67.71 67.71 67.75 Table 4. PSNR values for EBCOT, TJ and FC code for different bpp and band plane 30 for Lena image Band Plane(30) bits per pixel PSNR Values EBCOT TJ[12] FC (proposed) 0.01 28.32 28.32 28.50 0.10 32.92 32.92 33.00 0.20 36.10 36.10 36.50 0.30 39.67 39.67 40.10 0.40 43.22 43.22 43.25 0.50 47.25 47.25 47.50 0.60 52.06 52.06 52.22 0.70 67.71 67.71 67.75 0.75 67.71 67.71 68.11 For visual comparison, the original and reconstructed images of Lena with EBCOT and the proposed method for band plane 0, at bpp = 0.1 are shown in Fig. 5(a) – (c).

ISSN: 0975-5462

7317

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319

6. Conclusion In this paper we have proposed a new method to compress the scalar quantized integers in the JPEG2000, using Fibonacci Coding by replacing EBCOT. The integer numbers are represented using Zeckendorf’s theorem. Experimental results on standard images show that the proposed method gives better results in terms of PSNR value when compared to EBCOT based JPEG2000. References [1] Shariq Haseeb, Othman O.Khalifa,”Comparative Performance Analysis of Image Compression by JPEG2000:A Case Study on Medical Images”, Information Technology Journal, pp35-39,2006. [2] P. Franti, O.Nevalainen and T. Kauranta,”Compression of digital images by Block Truncation Coding a Survey”, The Computer Journal, pp308-332,1994. [3] Antonin Descampe, Gael Rouvroy, Jean-Jacques Quisquater, “ A Flexible, Hardware JPEG2000 Decoder for Digital Cinema”, IEEE Transactions on Circuits and Systems for Video Technology, pp.13971410,2006. [4] Zhen Liu, Lina J.Karam, Andrew B.Watson, “ JPEG2000 Encoding With Perceptual Distortion Control”, IEEE Transactions on Image Processing, pp.1763-1778, 2006. [5] Qian Du, James E.Fowler,” Hyperspectral Image Compression Using JPEG2000 and Principal Component Analysis”, IEEE Geoscience and Remote Sensing Letters,pp201-205,2007. [6] Zahia Brahimi. et.al, “Selective Encryption Techniques of JPEG2000 Codestream for Medical Images Transmission”, WSEAS Transactions on Circuits and Systems, pp.718-727,2008. [7] Diego De Luca Picione et.al “A FIBONACCI LSB DATA HIDING TECHNIQUE”, 14th European Signal Processing Conference, pp.4-8,2006. [8] Aleksandra Mojsilovic and Emina Soljanin, “Color Quantization and Processing by Fibonacci Lattices”, IEEE Transactions on Image Processing, pp.1712-1725,2001. [9] http://www.mahalo.com/fibonacci-code.

ISSN: 0975-5462

7318

K. Somasundaram et al. / International Journal of Engineering Science and Technology Vol. 2 (12), 2010, 7311-7319 [10] C.Kimberling, “Edouard Zeckendorf”, Fibonacci Quart, Springer Online Reference Work,pp129-132,1998. [11] R.Bastys,”Fibonacci Coding Within the Burrows-Wheeler Compression Scheme”, Electronics and Electrical Engineering-Kaunas: Technologija, pp.28-32,2010. [12] Teerapat Sanguankotchakorn and Jeerakit Fangtham “ A New Approach to Reduce Encoding Time in EBCOT Algorithm for JPEG2000” IEEE Journal, pp1338 - 1342 , 2003. Somasundaram .K was born in the year 1953. He received the M.Sc degree in Physics from University of Madras, Chennai, India in 1976, the Post Graduate Diploma in Computer Methods from Madurai Kamaraj University, Madurai, India in 1989 and the Ph.D degree in theoretical Physics from Indian Institute of Science, Bangalore, India in 1984. He is presently the Professor and Head of the Department of Computer Science and Applications, and Head, Computer Centre at Gandhigram Rural Institute, Gandhigram, India. From 1976 to 1989, he was a Professor with the Department of Physics at the same Institute. He was previously a Researcher at an International Centre for Theoretical Physics, Trieste, Italy and a Development Fellow of Commonwealth Universities at the school of Multimedia, Edith Cowan University, Perth, Australia. His research interests are in image processing, image compression and medical imaging. He is a Life member of Indian Society for Technical Education. He is also an annual member in ACM, USA and IEEE Computer Society,USA. Sumitra. P received her M.Phil Degree in Computer Science from Mother Teresa Women’s University, Kodaikannal, Tamil Nadu, India in the year 2003 and received her M.Sc Degree in Computer Science from Madurai Kamaraj University, Madurai, TamilNadu, India in the year 1998. She is doing her Ph.D(Image Compression) and currently she is working as a Assistant Professor in Dept of Computer Science, Vysya College, Salem. She published one International Journal paper, three papers in International Conference and seven papers in National Conferences. Her research areas include Image Processing, Design and Analysis of Algorithm and Artificial Intelligence. She has 8 years of teaching experience in self finance institutions.

ISSN: 0975-5462

7319