VIEWS: 192 PAGES: 7 CATEGORY: Emerging Technologies POSTED ON: 2/15/2011 Public Domain
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 1 Analysis of Error Metrics of Different Levels of Compression on Modified Haar Wavelet Transform 1 T.Arumuga Maria Devi,Assistant Professor,Centre for Information Technology and Engineering,Manonmaniam Sundaranar University,Tirunelveli .TamilNadu. 2 S.S.Vinsley, Student IEEE Member,Guest Lecturer,Manonamaniam Sundaranar University,Centre for Information Technology and Engg,Manonmaniam Sundaranar University, Tirunelveli.TamilNadu. contains a large amount of spatial redundancy in plain areas where adjacent picture elements (pixels, pels) have almost Abstract—Lossy compression techniques are more efficient in same values. It means that the pixel values are highly terms of storage and transmission needs. In the case of Lossy correlated [31]. The basic measure for the performance of a compression, image characteristics are usually preserved in the compression algorithm is Compression Ratio (CR). In a lossy coefficients of the domain space in which the original image is transformed. For transforming the original image, a simple but compression scheme, the image compression algorithm efficient wavelet transform used for image compression is called should achieve a tradeoff between compression ratio and Haar Wavelet Transform. The goal of this paper is to achieve image quality [32]. The balance of the paper is organized as high compression ratio in images using 2 D Haar Wavelet follows: In section II describes the properties and advantages Trnasform by applying different compression thresholds for the of haar wavelet transformation. In section III considers the wavelet coefficients and these results are obtained in fraction of seconds and thus to improve the quality of the reconstructed procedure for haar wavelet transformation. In section IV, image ie., to arrive at an approximation of our original image. Implementation methodologies for wavelet compression and Another approach for lossy compression is, instead of linear algebra are discussed. In section V describes the transforming the whole image, to separately apply the same algorithm for its implementation. In section VI considers the transformation to the regions of interest in which the image comparison for metrics. In section VII considers the graphs, could be devided according to a predetermined characteristic. HWT image compression output results, and these results are The Objective of the paper deals to get the coefficients is nearly closer to zero. More specifically, the aim of the thesis is to plotted between various parameters. In section VIII exploit the correlation characteristics of the wavelet coefficients elaborates on the importance of this paper, some applications as well as second order characteristics of images in the design of and its extensions. Quality and compression can also vary improved lossy compression systems for medical images. Here a according to input image characteristics and content. Images modified simple but efficient calculation schema for Haar need not be reproduced exactly. An approximation of the Wavelet Transform. original image is enough for most purposes, as long as the Index Terms—Haar Wavelet Transform – Linear Algebra error between the original and the compressed image is Technique – Lossy Compression Technique – MRI tolerable. Lossy compression technique can be used in this area. I. INTRODUCTION II. PROPERTIES AND ADVANTAGES OF HAAR WAVELET TRANSFORM I Nrecent years, many studies have been made on wavelets. An excellent overview of what wavelet have brought to the The Properties of the Haar Transform are described as follows: fields as diverse as biomedical applications, wireless communication, computer graphics or turbulence [30]. Image compression is one of the most visible applications of Haar Transform is real and orthogonal. Therefore wavelets. The rapid increase in the range and use of Hr=Hr* (1) electronic imaging justifies attention of systematic design of Hr-1 = Hr T (2) an image compression system and for providing the image Haar Transform is a very fast transform . quality needed in different applications. A typical still image 127 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 2 The basis vectors of the Haar matrix are sequency IV. IMPLEMENTATION METHODOLOGY ordered. Haar Transform has poor energy compaction for Each image [27] is presented mathematically by a matrix images. of numbers. Haar wavelet uses a method for manipulating the Orthogonality: The original signal is split into a low matrices called averaging and differencing. Entire row of a and a high frequency part, and filters enabling the image matrix is taken, then do the averaging and differencing splitting without duplicating information are said to be process. After we treated entire each row of an image matrix, orthogonal. then do the averaging and differencing process for the entire Linear Phase: To obtain linear phase, symmetric filters each column of the image matrix. Then consider this matrix would have to be used. is known an semifinal matrix (T) whose rows and columns Compact support: The magnitude response of the filter have been treated. This procedure is called wavelet should be exactly zero outside the frequency range transform. covered by the transform. If this property is satisfied, Then compare the original matrix and last matrix the transform is energy invariant. that is semifinal matrix(T), the data has became smaller. Perfect reconstruction: If the input signal is Since the data has become smaller, it is easy to transform and transformed and inversely transformed using a set of store the information. The important one is that the treated weighted basis functions, and the reproduced sample information is reversible. To explain the reversing process values are identical to those of the input signal, the we need linear algebra. Using linear algebra is to maximize transform is said to have the perfect reconstruction compression while maintaining a suitable level of detail. property. If, in addition no information redundancy is present in the sampled signal, the wavelet transform is, A. Wavelet Compression Methodology as stated above, ortho normal. From Semi final Matrix (T) is ready to be compressed. [29] No wavelets can possess all these properties, so the choice Definition of Wavelet Compression is fix a non negative of the wavelet is decided based on the consideration of which threshold value ε and decree that any detail coefficient in the of the above points are important for a particular application. wavelet transformed data whose magnitude is less than or Haar-wavelet, Daubechies-wavelets and biorthogonal- equal to zero (this leads to a relatively sparse matrix). Then wavelets are popular choices [1]. These wavelets have rebuild an approximation of the original data using this properties which cover the requirements for a range of doctored version of the wavelet transformed data. In the case applications. of image data, we can throw out a sizable proportion of the detail coefficients in this and obtain visually acceptable The advantages of Haar Wavelet transform as follows: results. This process is called lossless compression. When no information is loss (eg., if =0). Otherwise it is referred to as 1. Best performance in terms of computation time. lossy compression (in which case >0). In the former case, 2. Computation speed is high. we can get our original data back, and in the latter we can 3. Simplicity build an approximation of it. Because we know this, we can 4. HWT is efficient compression method. eliminate some information from our matrix and still be 5. It is memory efficient, since it can be calculated inplace capable of attaining a fairly good approximation of our without a temporary array. original matrix. Doing this, we take threshold value ε=10 ie., reset to zero all elements of semifinal matrix(T) which are less than or equal to 10 in absolute value. From this we obtain III. PROCEDURE FOR HAAR WAVELET TRANSFORM the doctored matrix. Then apply the inverse wavelet transform to doctored matrix we get the reconstructed To calculate the Haar transform of an array of n samples: approximation R. In this process, we can get a good approximation of 1. Find the average of each pair of samples. (n/2 the original image. We have lost some of the detail in the averages) image but it is so minimal that the loss would not be 2. Find the difference between each average and the samples noticeable in most cases. it was calculated from. (n/2 differences) 3. Fill the first half of the array with averages. 4. Fill the second half of the array with differences. 5. Repeat the process on the first half of the array. (The array length should be a power of two) 128 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 3 B. Linear Algebra Methodology Display the resulting images and comment on the quality of the images. To apply the averaging and differencing using linear Calculate MSE, MAE & PSNR values of different algebra [27] we can use matrices such as A1,A2,A3…..An. Compression Ratios for corresponding Reconstructed that perform each of the steps of the averaging and images. differencing process. Then add a small amount of white noise to the input image. Default : variance =0.01, sigma=0.1, mean=0 i. When multiplying the string by the first matrix of the first half of columns are taking the average of each pair To compute the haar wavelet transform, set all the and the last half of columns take the corresponding approximation coefficients to zero except those differences. whose magnitude is larger than 3 sigma. ii. The second matrix works in much the same way, the first This same case is applicable to detail coefficients half of columns now perform the averaging and that is horizontal, vertical & diagonal coefficients. differencing to the remaining pairs, and the identity Reconstruct an estimate of the original image by matrix in the last half of columns carry down the detail applying the corresponding inverse transform. coefficient from step i. Display and compare the results by computing the iii. Similarly in the final step, the averaging and differencing root mean square error, PSNR, and mean absolute is done by the first two columns of the matrix, and the error of the noisy image and the denoising image. identity matrix carries down the detail coefficient from The same process is repeated for various images and previous step. compare its performance. iv. To simplify this process, we can multiply these matrices together to obtain a single transform matrix Alternative approach Algorithm is described as follows: W=A1A2A3) we can now multiply our original string by just one transform matrix to go directly form the original 1. Read the image cameraman.tif from the user. string to the final results of step iii. 2. Using 2D wavelet decomposition with respect to a haar v. In the following equation we simplify this process of wavelet computes the approximation coefficients matrix matrix multiplication. First the averaging and CA and detail coefficient matrixes CH, CV, CD differencing and second the inverse of those operation. (horizontal, vertical & diagonal respectively) which is obtained by wavelet decomposition of the input matrix ie., im_input. 1. T= ((AW)T W))T T= (WT AT W)T 3. From this, again using 2D wavelet decomposition with respect to a haar wavelet computes the approximation T= WT (AT)T (WT)T and detail coefficients which are obtained by wavelet T=WTAW (3) decomposition of the CA matrix. This is considered as level 2. 2. (W1)-1 T W-1 = A (W-1)1TW-1=A (4) 4. Again apply the haar wavelet transform from CA matrix which is considered as CA1 for level 3. 5. Do the same process and considered as CA2 for level 4 V. ALGORITHM 6. Take inverse transform for level 1, level 2, level 3 & level 4 that ie., im_input, CA, CA1, CA2. Read the image from the user. 7. Reconstruct the images for level 1, level 2, level 3 & Apply 2 D DWT using haar wavelet over the image level 4. For the computation of haar wavelet transform, set 8. Display the results of reconstruction 1, reconstruction 2, the threshold value 25%, 10%, 5%, 1% ie., set all reconstruction 3, reconstruction 4 ie., level 1 , 2 , 3 , 4 the coefficients to zero except for the largest in with respect to the original image. magnitude 25%, 10%, 5%, 1% . And reconstruct an approximation to the original image by apply the corresponding inverse transform with only modified approximation coefficients. This simulates the process of compressing by factors of ¼,1/10,1/20,1/100 respectively. 129 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 4 VI. METRICS FOR COMPARISON 2 PSNR=10xlog10 255 (9) A. Compression Metrics ! N1 N 2 2 ( f ( x, y) g ( x, y)) The type of compression metrics [21] used for digital data N1 N 2 y 1 z 1 varies quite markedly depending on the type of compression And also Mean Absolute Error is denoted by employed that use a simple ratio formula as given below 1 N Output File size (bytes) MAE= |g(x,y)-f(x,y)| (10) CompressionRatio(%)= x100 (5) N i 1 Input File size (bytes) The standard error measures a large distortion, but the A measure of rate is far more suitable metric for large image has merely been brightened. Individually, MSE, SNR compression ratios as it gives the number of bits per pixel and PSNR are not very good at measuring subjective image used to encode an image rather than some abstract quality, but used together these error metrics are at least percentage. adequate at determining if an image is reproduced at a certain 8 x Output File size (bytes) quality. Rate(bpp)= (6) Input File size (bytes) Rate, for image coding purposes, uses bits per pixel (bpp) VII. RESULTS AND DISCUSSIONS as its unit. The project deals with the implementation of the haar B. Error Metrics wavelet compression techniques and a comparison over various input images. We first look in to results of wavelet In general, error measurements are used on lossy compression technique by calculating their comparison ratios compressed images to try and quantify the quality of a and then compare their results based on the error metrics picture. Getting a quantifiable measure of the distortion which is shown in Table I. between two images is very important as one can try and Table I minimize this thesis so as to better replicate the original Different types of Error Metrics with respect to Various image. There are many ways of measuring the fidelity of a Compression Ratios. picture g(x,y) to its original f(x,y). One of the simplest and Compression Error Metrics most popular methods is to use the difference between f and Ratios MSE RMSE PSNR g. In its most basic form is the mean square error (MSE) [11] 4:01 9937.92 99.6891 18.7841 given by, 10:01 14380.1 119.917 15.0893 1 N1 N2 20:01 15990.1 126.452 14.028 MSE= N1 N 2 ( f ( x, y) g ( x, y)) y 1 z 1 2 (7) 100:1 17453.28 132.1109 13.1524 where f and g are N1xN2 size image. This is a very useful A. Effects on Compression Ratio Vs Various Parameters measure as it gives an average value of the energy loss in the lossy compression of the original image f. Signal-to-noise Wavelet Compression is applied for all images and the ratio (SNR) is another measure often used to compare the compression ratio is being calculated. The image quality thus performance of reproduced images which is defined by, measured in compression techniques is compared using a BAR CHART, which proves the image quality of the various ! N1 N 2 input images which reconstructed images are better. This is SNR=10xlog10 f ( x, y) 2 N1 N 2 y 1 z 1 (8) shown in Fig 1 & 2. COMPRESSION RATIO VS MSE ! N1 N 2 2 ( f ( x, y) g ( x, y)) N1 N 2 y 1 z 1 50000 40000 4:01 30000 MSE 10:01 SNR is measured in dB's and gives a good indication of the 20000 20:01 ratio of signal to noise reproduction. This is a very similar 10000 100:01:00 measurement to MSE. A more subjective qualitative 0 measurement of distortion is the Peak Signal-to-noise ratio if if tif f f .ti .ti r.t t.t . ce ri an ar gh (PSNR) [3]. m ri cm m ei ne bo IMAGES Fig. 1. Effects on Compression Ratio Vs MSE with Respect to Various Input Images 130 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 5 PSNR values depend on image type and cannot be used to COMPRESSION RATIO Vs PSNR compare images with different content. 70 60 4:01 The quality of the reconstructed image is measured using 50 the error metrics: 10:01 40 MSE PSNR 30 20:01 PSNR 20 100:01:00 10 The values of MSE & PSNR are calculated for all test images 0 and are provided in Table II. cman.tif mri.tif eight.tif bonemarr.tif rice.tif IMAGES Table II Fig. 2. Effects on Compression Ratio Vs PSNR with Calculation of different kinds of Error Metrics with respect to Respect to various input images Various Input images under Compression Ratio 100:1 In the first experiment, we report on Compressed Ratio No of consumed by Error Metrics as described in the previous SI.No Image elements to MSE PSNR section. In our experiments, we used the gray scale sample, store in bytes cameraman.tif of size 256*256. And measured the 1 cman.tif 256*256 17543.280 13.1524 compression ratio and the PSNR of the compressed image. In 2 Rice.tif 256*256 13094.653 16.0257 each case, the threshold level was changed and got the output. 3 Mri.tif 128*128 1248.827 39.5257 The results are presented in Fig 5. The x-axis represents 4 Eight.tif 242*308 41227.182 4.5567 Compression Ratio, while the y-axes represent MSE with 5 Bonemarr.tif 238*270 28009.786 8.4222 various input images. In the Second experiment, we report on Compression Ratio VIII. CONCLUSION Vs PSNR with various input images. In our experiments, we used the gray scale image samples. In each case, the threshold This paper reported is aimed at developing computationally level was changed and got the output. The results are efficient and effective algorithm for lossy image compression presented in Fig 5. The x-axis represents Compression ratio, using wavelet techniques. This paper is particularly targeted while the y-axes represents PSNR with various input towards wavelet image compression using Haar images. Transformation with an idea to minimize the computational requirements to achieve good reproduction image quality. In The quality of compressed image depends on the no of this direction the following methods are developed. This decompositions. The no of decompositions determines the image compression schemes for images have been presented resolution of the lowest level in wavelet domain. Using larger based on the 2 D HWT. The promising results obtained no of decompositions, that will be more successful in concerning reconstructed image quality as well as resolving important HWT coefficients from less important preservation of significant image details, while on the coefficients. After decomposing the image and representing otherhand achieving high compression rates. it with wavelet coefficients, compression can be performed by ignoring all coefficients below some threshold. In this High compression ratio and better image quality experiment, compression is obtained by wavelet coefficient obtained which is better than existing methods. thresholding. All coefficients below some threshold are In addition, the above methods are to be for noisy neglected and Compression Ratio is computed. Compression images Algorithm operation is follows : Compression Ratio is fixed to the required level and threshold value has been changed to To improve the quality of the reconstructed image achieve required Compression Ratio after that PSNR is The results are executed in fraction of seconds. computed. PSNR tends to saturate for a larger no of To obtain the wavelet coefficients are nearly closer to decompositions. For each compression ratio, the PSNR zero. characteristic has “threshold” which represents the optimal no of decompositions. Below and above the threshold PSNR Image denoising techniques will allow precise imaging decreases and no of decomposition increases. PSNR is at much faster rates by greatly reducing the necessary increased up to some no of decompositions. Beyond that, averaging time to construct low noise images. increasing the no of decomposition has a negative effect. 131 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 6 The performance of an image compression algorithm is implementation issues such as bit allocation methods and basically evaluated in terms of compression ratio, MSE, and error estimation can be studied. PSNR. A `good' algorithm has a high compression ratio. Wavelet based image compression theory has rapidly Image denoising method using wavelet for noisy image increased in the last seven years. With the increasing use of could be developed. This yield better result in image multimedia technologies image compression requires higher compression techniques using wavelet for noisy input images. performance as well as new functionality. To address this need in the specific area of still image compression here a IX. REFERENCES new compression technique is proposed. The results proved [1] Sonja Grgic, Mislav Grgic, Member, IEEE, and Branka Zovko-Cihlar, that the compression ratio is very high and the reconstruction Member, IEEE, “Performance Analysis of Image Compression Using is same as that of the original image. Wavelets”, IEEE Trans. Vol. 48., No 3, 2001. Wavelet based image compression indeed is a new and [2] Detlev Marpe, Member, IEEE, Gabi Blättermann, Jens Ricke, and Peter Maa, “A Two-Layered Wavelet-Based Algorithm for Efficient Lossless emerging area and has a lot of scope for improvement and and Lossy Image Compression”, IEEE transactions on circuits and extension. In future the following aspects may be considered systems for video technology, vol. 10, no. 7, october 2000. for improving the algorithm. [3] Rafael C Gonzalez, Richard E Woods “Digital Image Processing” Pearson Asia Education 2nd edition. This paper has focused on development of efficient and effective algorithm for still image compression. Fast and lossy [4] Anil K Jain “Fundamental of image processing” Pearson Asia Education. coding algorithm using wavelet is developed. [5] Mulcahy, colm PH.D, “ Image Compression using haar wavelet transform“, Spelman Science and Math Journal. Results shows that reduction in encoding time with little [6] Corban Radu, Ungureanu Iulian, “DCT Transform and Wavelet degradation in image quality compared to existing methods. Transform in Image Compression Applications”. While comparing the developed method with other methods compression ratio is also increased. [7] Amara Graps, "An Introduction to Wavelets," IEEE Computational Science and Engineering, vol. 2, no. 2, Summer 1995. Some of the applications require a fast image compression [8] Wim Sweldens and Peter Schroder ,“Building Your Own Wavelet at technique but most of the existing technique requires Home”. considerable time. So this proposed algorithm developed to [9] Christopher Torrence and Gilbert P. Compo Program in Atmospheric compress the image so fastly. and Oceanic Sciences, University of Colorado, Boulder, Colorado, “A Practical Guide to Wavelet Analysis”. Wavelet transform is popular in image compression mainly [10] Martin Vetterl, “Wavelets, Approximation, and Compression” 2001 because of its multi resolution and high energy compaction IEEE Signal Processing Magazine. properties. Pictures or images are non stationary in frequency and spatial content; hence, data representing picture content [11] Bryan E, Usevitch “A Tutorial on modern lossy wavelet Image Compression Foundation of JPEG 2000”, IEEE signal processing may be any where in the actual picture. This property is magazine. included in this thesis. [12] D.A. Karras, S.A. Karkanisand B.G. Mertzios, ”Image Compression Using the Wavelet Transform on Textural Regions of Interest”. The main bottleneck in the compression lies in the search of domain, which is inherently time expensive. This leads to [13] Ligang Ke And Micheal W. Marcellin, “Near Lossless Image excessive compression time. The algorithm can be improved Compression: Minimum Entropy, Constrained-Error DPCM”, Department Of Electrical & Computer Engineering, University Of by applying some indexing scheme. Arizona . The algorithm needs to be explored and tuned for domain [14] Nelson, M, The Data Compression Book, 2nd Edition Publication, 1996 . specific application one of the major application area lies in [15] William K. Pratt, “Digital Image Processing”, John Wiley And Sons, the satellite imagery. As large quantity remote sensing data Inc., Second Edition, New York, 1991. are collected on a regular basis for different level resource [16] Raghuveer M. Rao And Ajit S. Bapardikar, “Wavelet Transforms”, monitoring, there is an increasing need for compression for Addison - Wesley, First Edition, 2000. better data management. Through investigations of different categories of satellite imagery are required and SNR, depth [17] H.R. Mahadevaswamy, P. Janardhanan and Y. Venkataramani, “Lossless Image Compression using Wavelets - A Comparative Study”, of search etc. are to be studied to determine the usability of Proceedings of National Communication Conference, NCC’99, IIT fractal image compression. Khargpur, India, pp.345-352, Allied Publishers, NewDelhi, January 1999. Better visual modules and perception based error criteria [18] A.R. Calderbank, Ingrid Dauchies, Wim Sweldens, and Boon lock Yeo, are needed for image coding. Using wavelet number of “Lossless Image Compression using Integer to Integer Wavelet 132 http://sites.google.com/site/ijcsis/ ISSN 1947-5500 (IJCSIS) International Journal of Computer Science and Information Security, Vol. 9, No. 1, January 2011 7 Transforms”, International conference on Image Processing, ICIP’97, Vol 1, No.385, pp.596-599, Oct 1997. [19] Amir Said, and William A. Pearman, “An Image Multiresolution Representation For Lossless And Lossy Compression”, IEEE Transactions on Image Processing, Vol.5, pp.1303-1310, Sept.1996. [20] Marc Antonini, Miche, Barland, Pierre Mathieu, and Ingrid Daubechies, “Image Coding Using Wavelet Transform”, IEEE Transactions on Image Processing, Vol.1, No:2, pp.205-220 ,April 1992. [21] Osma K.Al-Shaykh, and Russell M.Mersereau, “Lossy Compression of Noisy Images”,IEEE Transactions on Image Processing, Vol.7, No.12, pp.1641-1652, December 1998. [22] Athanassios Skodras, Charilaos Christopoulos, and Touradj Ebrahimi “The JPEG 2000 Still ImageCompression Standard “ in “IEEE Signal processing”, Sep 2001. [23] Arun N. Netravali and Barry G. Haskell, “Digital Pictures- Representation, Compression, and Standards”, Plenum Press, New York, 2nd Edition, 1994. [24] S. Golomb, “Run Length Encodings”, IEEE Transactions on Information Theory,Volume IT-12, pp.399-401, 1986. [25] Peggy Morton and Karin Glinden , “Image Compression using the haar wavelet transform”, Plenum Press, October 1996. [26] Peggy Morton & Arne Petersen , “Image Compression using the haar wavelet transform “, Math 45 – College of the Redwoods , December 1997. [27] LiHong Huang Herman , “Image Compression using the haar wavelet transform, Plenum Press, December 13, 2001. [28] http://www.spelman.edu/~colm/ [29] http://online.redwoods.cc.ca.us/instruct/darnold/fall 2002/ames/ [30] Proc. IEEE(special issue on wavelets), vol 84, Apr. 1996. [31] N. Jayant & P. Noll, Digital Coding waveforms: Principles & Applications to Speech & Video Englewood Cliffs, NJ. Prentice Hall, 1984. [32] B. Zovko – Cihlar, S. Grgic & D. Modric , “ Coding techniques in multimedia communication “ I Proc 2nd Int. Workshop Image & Signal Process IWISP ’95 , Budapest, Hungary, 1995. Fig. 3: Original and Haar Wavelet Transformed images for Different Levels Fig. 4: Reconstructed Images for different Levels 133 http://sites.google.com/site/ijcsis/ ISSN 1947-5500