• No results found

Different Transforms for Image Compression

N/A
N/A
Protected

Academic year: 2021

Share "Different Transforms for Image Compression"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

Available Online at www.ijecse.org ISSN- 2277-1956

Different Transforms for Image Compression

Ritu Raj

Department of Electronics and Communication Engineering

Assistant Professor, ANACEMS Bareilly U.P. Email- [email protected]

Abstract: The main objective of this paper is to focus on three techniques of image compression Burrows Wheeler Transform (BWT), Discrete Cosine Transform (DCT), and Discrete Wavelet Transform (DWT). Image processing systems can encode raw images with different degrees of precision, achieving varying levels of compression. Different encoders with different compression ratios can be built and used for different applications. The need to dynamically adjust the compression ratio of the encoder arises in many applications. One example involves the real-time transmission of encoded data over a packet switched network. To suitably adapt the encoder to varying compression requirements, adaptive adjustments of the compression parameters are required. This involves reconfiguring the encoder in an efficient manner. The main constraint of limitation is the memory of the system. Memory plays a key role in the multimedia devices and the data storage devices, where the images are considerably bulky. The compression ratio in each of the three cases varies which gives the exact idea of how much the image has been compressed. These techniques were implemented using MATLAB and SIMULINK.

Keywords: BWT, DCT, DWT, Histogram

I.INTRODUCTION

The amount of data associated with visual information is so large that its storage would require enormous storage capacity. Although the capacities of several storage media are substantial, their access speeds are usually inversely proportional to their capacity. Storage and/or transmission of such data require large capacity and/or bandwidth, which could be very expensive. Image data compression techniques are concerned with reduction of the number of bits required to store or transmit images without any appreciable loss of information.

Most representations of information do not optimize usage of resources. For example, one could replace every “qu” in English with a ‘‘q’’, removing a lot of u’s. Likely, the text will convey the same information as before, but take less space. Why is no information loss? Because those u’s are redundant lossless compression of data is removal of redundancy in the data while preserving the ability to return the data to its original form. Lossy compression involves the discarding of “unimportant” information from the data which then cannot be recovered. Lossless compression involves compressing data which when decompressed, will be an exact replica of the original data. This is the case when binary data such as executables, documents etc. are compressed. They need to be exactly reproduced when decompressed. On the other hand, images (and music too) need not to be reproduced ‘exactly’. An approximation of the original image is enough for most purposes, as long as error between the original image and the compressed image is tolerable.

Fundamental Concept: Data redundancy [3] is an important term used in digital image compression. If m1 and m2

denote the no. of words used to represent the same information then relative data redundancy Ir is defined as Ir=1-1/Cr, where Cr=m1/m2... (i)

There are two major categories of compression algorithms: a. Lossless Data Compression- compression ratio up to 3:1.

(2)

In digital compression three important redundancies are identified. They are

a. Coding redundancy: Coding redundancy is due to inefficiencies in data representations.

b. Inter – pixel redundancy: is defined as failure to identify and utilize data relationship. If a pixel value can be reasonably predicted from its neighboring (or preceding/ following) pixels the image is said to contain inter-pixel redundancy.

c. Psycho-Visual redundancy: Psycho visual redundancy stem from the fact that human eye does not respond with equal intensity to all visual information. The human visual system does not rely on quantitative analysis of individual pixel values when interpreting an image, an observer searches for distinct features and mentally combines them into recognizing groupings. In this process certain information is relatively less important than other, this information is called psycho visually redundant.

II.METHODOLOGY

In this paper, three algorithms for image compression have been taken and are used to compress a color image. The three algorithms are namely Burrows Wheeler Transform (BWT), Discrete Cosine Transform (DCT), and Discrete Wavelet Transform (DWT). The algorithms was designed using the MATLAB and SIMULINK software and was implemented on grayscale image. These images were compressed using the three algorithms and the compression ratio was calculated by comparing the size of the original image and the compressed image. The compression ratio gives the exact idea of how much the image size has been reduced. The compression ratio for the three techniques is compared. The data obtained from compressing the image is used to compute the histogram of the compressed image. The histogram is used to compute the frequency distribution of the elements in each image by sorting the elements into a specified number of discrete bins. The difference between the original image and the compressed image is calculated which provides the error involved in compression.

III.EXPERIMENTALWORKANDRESULTS

Burrows Wheeler Transform

The Burrows Wheeler Transform [1, 2] is an algorithm that takes a block of data and rearranges it using a sorting algorithm. The resulting output block contains exactly the same data elements that it started with, differing only in their ordering. The transformation is reversible meaning original ordering of the data can be restored with no loss of fidelity. Compression is based upon two quite different transformations, a forward transformation, which permutes the input data into a form which is easily compressed, and a reverse transformation, which recovers original input from the permuted data. The BWT is performed on entire block of data at once. The Forward and Reverse compression algorithms [1] are discussed below.

Burrows Wheeler Forward Transformation: The steps for forward transformation is given below:

a. Write the input as the first row of matrix, one symbol per column.

b. Form all cyclic permutations of that row and write them as the other rows of matrix. c. Sort the matrix rows according to the lexicographic order in the elements of the rows.

d. Take as output the final column of the sorted matrix together with the number of the row which corresponds to the original input.

(3)

(a)

(b) (c)

Figure 1: (a) a sample set of data (b) cyclic permutation of the string (c) string sorted in lexicographic order

The output of the above string after forward transformation is: F = OBRSDDB5.

Burrows Wheeler Reverse Transformation: There are two steps required for reverse transformation-

a. Find first character of rotations, and b. Build list of predecessor character.

To perform these steps we require a Transformation Vector [1, 3]. The transformation vector, T, is an array with one index for each row in column of F.

Figure 2: transformation vector routes Figure 3: Complete transformation vector for the

given example

T[4]=0, T[0]=1, T[5]=2, T[6]=3,T[2]=4, T[3]=5, T[1]=6 So T=[1,6,4,5,0,2,3]

The block diagram for Burrows Wheeler Transform is shown below: [D R D O B B S]

(4)

(a) (b) Figure 4: (a) compression phase (b) decompression phase Results for Burrows Wheeler Transform

Result : For grayscale image

(a) (b) (c)

Figure 5: (a) original image, (b) compressed image, (c) reconstructed image

The Compression Ratio for the image is 1.1508.

Discrete Cosine Transform (DCT)

In general, images are represented as spatial representations in which every pixel is identified by three pieces of information: two coordinates that identify the location of the pixel and the color. Discrete Cosine Transform [8, 11] converts the spatial representation into a frequency-based spectral depiction. It does this by applying the following mathematical formula to each pixel in sub blocks of N X M pixels.

... (ii)

This creates a quantization matrix of frequency coefficients for each pixel based on luminance and chrominance. The lower frequency coefficients are located in the upper left hand corner of the matrix, while the higher frequency coefficients are found in the lower right corner. Most humans have more trouble differentiating among high- frequency colors than middle or lower frequency colors. As a result the higher frequency coefficients, which should already be near zero, can be set to zero, or mapped, with little distortion of the image. The number of coefficients that are mapped depends on the compression ratio desired. Also, the more coefficients that are discarded, the more degradation will occur in the image. Usually, the range of colors, referred to as the Q- factor, can be controlled by

(5)

... (iii)

The inverse discrete cosine transform algorithm [12, 13] results in the new compressed image.

DCT is very popular, because although some data is lost in the process, it can reach compression ratios of 37:1 before distortion begins to show. It accomplishes this by eliminating the information least important to the quality of the image.

The block diagram used to implement the forward and reverse DCT for image compression is shown below:

Figure 6: Block Diagram of Forward and Reverse DCT Results for Discrete Cosine Transform

Video Viewer5 Video Viewer Image Image Image Video Viewer4 Video Viewer Image Image Image Video Viewer3 Video Viewer Image Image Image Video Viewer2 Video Viewer Image Image Image Video Viewer1 Video Viewer Image Image Image Video Viewer Video Viewer Image Image Image Quantizing Encoder Quantizing Encoder U Idx Q(U) Quantizing Decoder Quantizing Decoder Idx Q(U)

Image From File lena .png R G B Frame Rate Display 33.2854 Compression ratio Bpp calculator I bits bpp ratio

Bits per pixel

2-D IDCT 2-D IDCT 2-D DCT

2-D DCT

Figure 7: Working model for DCT Result : For grayscale image

Input image 2-D DCT Quantizer/ Encoder Comp. image De-Quantizer/ Decoder 2-D IDCT Decomp ressed image

(6)

(a)

(b) (c)

(d) (e)

Figure 8: (a) original image (b) DCT output, (c) Quantized output, (d) De-Quantized output, (e) IDCT output of the original image

The Compression Ratio for the image is 6.5216.

Discrete Wavelet Transform

Wavelets are functions defined over a finite interval and having an average value of zero. The basic idea of the wavelet transform is to represent any arbitrary function as a superposition of a set of such wavelets or basis functions. These basis functions or baby wavelet are obtained from a single prototype wavelet called the mother wavelet, by dilations or contractions (scaling) and translations (shifts). The Wavelet transform provides us with both the time and frequency information of the signal or image.

The Discrete Wavelet Transform (DWT) [10] which based on sub-band coding is found to yield a fast computation of Wavelet Transform. Therefore it is easy to implement and reduces the computation time. In case of DWT, a time-scale representation of the digital signal is obtained using digital filtering techniques. The signal to be analyzed is passed through filters with different cut-off frequencies at different scales.

A multi-resolution analysis (MRA) [9, 10] or multi-scale approximation (MSA) is the design method of most of the practically relevant discrete wavelet transforms [5]. Wavelets are the foundation stone of multi-resolution analysis. As the name signifies, the multi-resolution theory is concerned with the representation and analysis of signals or images at more than one resolution. MRA is designed to give good time resolution and poor frequency resolution at high frequencies and good frequency resolution and poor time resolution at low frequencies. This approach makes sense especially when the signal at hand has high frequency components for short durations and low frequency components for long durations. Fortunately, the signals that are encountered in practical applications are often of this type

(7)

Figure 9: A two band subband coding and decoding structure

An important imaging technique which ties to multi-resolution analysis is subband coding [10]. In subband coding, an image is decomposed into asset of band-limited components, called subbands, which can be reassembled to reconstruct the original image without error. Each subband is generated by band pass filtering the input. Since the bandwidth of the resulting subbands is smaller than that of the original image, the subbands can be down sampled without loss of information. Reconstruction of the original image is accomplished by up sampling, filtering, and summing the individual subbands.

Digital image is represented as a two-dimensional array of coefficients, each coefficient representing the brightness level in that point. Most natural images have smooth color variations, with fine details being represented as sharp edges in between the smooth variation. Technically, the smooth variations in images can be termed as low frequency variations and the sharp variations as high frequency variations. The low frequency components (smooth variation) constitute the base of the image and the high frequency components (the edges which give the details) add upon them to refine the image thereby giving the detailed image. Hence, the smooth variations are more important than the details.

Figure 10: Block diagram (a) compression stage, (b) decompression stage

Digital image compression is based on the ideas of sub-band decomposition or Discrete Wavelet Transform. Fourier based technique use a fixed analysis window while wavelet-based techniques can be considered using a short window at high spatial frequency data and a long window at low spatial frequency data. This makes DWT more accurate in analyzing image signals at different spatial frequency, and thus can represent more precisely both smooth and dynamic regions in image. The compression system includes forward wavelet transform, a quantizer and a lossless entropy encoder.

(8)

(a) (b)

Figure 11: Subband coding (a) Decomposition step, (b) Reconstruction Step Results for Discrete Wavelet Transform

Result : For grayscale image

(a) (b) (c)

Figure 12: (a) original image, (b) second level decomposition, (c) reconstructed image

The Compression Ratio for the image is 65.536.

Histogram Calculation

Statistical information are those which provide information about the data values which make up the image i.e. it gives the detailing of the image and its color components. Histograms [6] are the basis for numerous spatial domain processing techniques. Histogram manipulation can be used effectively for providing useful image statistics. The Histogram block can be used to compute the frequency distribution of the elements in each input image by sorting the elements into a specified number of discrete bins. It can also be used to calculate the histogram of the R, G, and/or B values in an image.

(9)

Figure 13: Model for statistical information for grayscale image Results for histogram calculation

Result : for grayscale image

(a) (b) (c) (d) Figure 14: Histogram of (a) original image, (b) BWT image, (c) DCT image, (d) DWT image

IV.COMPARATIVEANALYSIS

The analysis between the three transform has been done on the basis of compression ratio and the error obtained between the original and reconstructed image.

Table 1: Comparison between compression ratio and

error for grayscale image

Technique Compression Ratio Error between Original and Reconstructed Image BWT 1.1508 0 DCT 6.5216 47.0735 DWT 65.536 76.382

So, from the analysis we can see that as we increase the compression ratio the error between the original and reconstructed image increases and as the error increase the quality of image gets degraded.

(10)

V. CONCLUSION

So from the results obtained, we can see the large variation in the compression ratio. The Burrows Wheeler Transform ha got the least compression ratio followed by Discrete Cosine Transform and then Discrete Wavelet Transform. Another thing can be seen from the table 1 that as the compression ratio increases the error between the original and compressed image also increase. So the compression ratio cannot be increased beyond a level since the error will not lie within tolerable limits. Hence there should be a tradeoff between the compression ratio and the quality of the image.

VI. REFERENCES

[1] Burrows, M. and Wheeler, D. J. (1994) A block-sorting lossless data compression algorithm. Technical Report SRC-124, Digital System Research Center, Palo Alto.

[2] Balkenhol, B. and Kurtz, S. (2000) Universal data compression based on the Burrows-Wheeler transformation: theory and practice, Bielefeld University.

[3] Mantaci, S. and Restivo, A. and Rosone, G. and Sciortino, M. (2005) An Extension of the Burrows Wheeler Transform and Applications to Sequence Comparison and Data Compression, Volume 3537/2005, 427-463.

[4] Haitao, Guo and Burrus, C.S. (1997) Waveform Compression using the Burrows Wheeler transform and the wavelet transform, Proceedings of International Conference on Image Processing, 65 - 68 vol.1.

[5] Jain, C. and Chaudhary, V. and Jain, K. and Karsoliya, S. (2011) Performance analysis of integer wavelet transform for image compression, 3rd International Conference on Electronics Computer Technology (ICECT), Volume : 3 On page(s): 244 - 246

[6] Kawahara, M. and Yi-Jen Chiu and Berger, T. (1998) High-speed software implementation of Huffman coding, Data Compression Conference, DCC '98 Proceedings, On page(s): 553

[7] Jackson, D.J. and Hannah, S.J. (1993) Comparative analysis of image compression techniques. Twenty-Fifth Southeastern Symposium on System Theory. Proceedings SSST '93, On page(s): 513 - 517

[8] Shimauchi, K. and Ogawa, M. and Taguchi, A. (2004) JPEG based image compression with adaptive resolution conversion system, International Symposium on Circuits and Systems, ISCAS '04. Volume: 5 on page(s): V-437 - V-440

[9] Patrick Longa and Ali Miri and Miodrag Bolic (2007) A flexible design of filter bank architectures for discrete wavelet transforms [J].IEEE, on pages 1441-1444.

[10] Mallat, S.G. (1989) A theory for multi-resolution signal decomposition: The Wavelet Representation [J], IEEE Trans on PAMI, on pages: 674-693.

[11] Watson, Andrew B. (1994) Image Compression Using the Discrete Cosine Transform Mathematica Journal, 4(1), 1994, p. 81-88 NASA Ames Research Center.

[12] Nam Ik Cho and Mitra, Sanjit K. (2000) Warped Discrete Cosine Transform and Its Application in Image Compression IEEE Transactions on Circuits and Systems for Video Technology, VOL. 10, NO. 8.

[13] Nacer, Z.N. and Zergaiizoh A. and Merigot, A. (2001) Global Discrete Cosine Transform for Image Compression in International Symposium on Signal Processing and its Applications (ISSPA), Kuala Lumpur, Malaysia.

[14] E. Elharar and Adrian Stern and Ofer Hadar (2007) A Hybrid Compression Method for Integral Images Using Discrete Wavelet Transform and Discrete Cosine Transform IEEE Journal of Display Technology, VOL. 3, NO. 3.

[15] Lei Wan and Jiaji Wu and Licheng Jiao and Li Zhang and Guangming Shi (2008) Lossy to Lossless Image Compression based on Reversible DCT, China.

References

Related documents

Keywords: emotional intelligence, educational leadership, phenomenological study, elementary teachers, qualitative design, transformational leadership...

alloys of platinum and rhodium, lately pub- lished in the ‘Philosophical Transactions’, settled the question in favour of the rhodium- platinum thermo-junction, for I

Evans, Nicole M., "The Process of Exercise Participation in the Community for Functional Recovery Post Formal Rehabilitation among Survivors of Stroke: a grounded theory

Classroom behaviour management belief of school science teachers places an affirmative effect on teachers’ positive attitude towards constructivist approach in

cepa cells exposed to Aligarh wastewater, refinery wastewater and the test heavy metals exhibited a high percentage of chromosomal aberrations as compared to control.. Moreover, it

Alain Locke’s Inner Life theory on the other hand considered the African American theatre medium as the vehicle of the New Negro, by which real life, believable

The present study seeks to examine whether victimization (i.e., being the target of bullying) is more common among high school students in the arts than high school students

During a focus group with Annie, Bethany, and James, I asked the participants. suggestions for encouraging African-Americans to participate