International Journal for Science and Emerging ISSN No. (Online):2250-3641 Technologies with Latest Trends 5(1): 19-23 (2013) ISSN No. (Print): 2277-8136 Image Compression using hybrid of DWT,DCT and Huffman Coding Sandhya Sharma* and Sarabjeet Kaur** Electronics and communication Department let Bhaddal, Ropar, India (Received 11January 2013 Accepted 18 January 2013) Abstract- This research paper presents a proposed method for the compression of medical images using hybrid compression technique (DWT, DCT and Huffman coding). The objective of this hybrid scheme is to achieve higher compression rates by first applying DWT and DCT on individual components RGB. After applying this image is quantized to calculate probability index for each unique quantity so as to find out the unique binary code for each unique symbol for their encoding. Finally the Huffman compression is applied. Results show that the coding performance can be significantly improved by the hybrid DWT, DCT and Huffman coding algorithm. Keywords- Image compression, hybrid, quantization, DWT, DCT, Huffman encoding, medical image. 1. INTRODUCTION A lot of hospitals handle their medical image data with computers. The use of computers and a network makes it possible to distribute the image data among the staff efficiently. X-Ray and CT produce sequence of images. The amount of data produced by these techniques is vast and this might be a problem when sending the data over a network. To overcome this problem image compression has been introduced in the field of medical. There have been numerous compression research studies, examining the use of compression as applied to medical images. To achieve higher degree of compression we have to choose the hybrid scheme of DWT, DCT and Huffman encoding compression technique. This thesis will propose an approach to improve the performance of medical image compression while satisfying medical team who need to use it. There are several types of image compressions available but in case of biomedical images the loss of diagonasability of the image is not tolerable and hence to achieve higher degree of compression without any significant loss in the diagonasability of the image. This paper describes the design flow of effective compression technique. An effective DWT algorithm has been performed on the RGB parts of the extracted input image separately. Once the DWT is performed on the image then next is to apply DCT by dividing the image into 60X60 blocks to make the components of frequency of the image which are greater than 60 as 0. After this histogram probability reduction function for all RGB components are calculated using Mean intensities. Then Image quantization is performed using q factor which calculates probability index for each unique quantity. After applying quantization, Huffman code for each unique symbol is calculated so as to compress the image using Huffman compression. At the end the Compression and Peak-signal-tonoise is calculated reducing the amount of data required to represent a given quantity of information 2. PROPOSED CODING ALGORITHHMS STEPS i. Load Image in MATLAB using Image Acquisition ii. Extract RGB Parts of Image Separately iii. Apply DWT Compression using symlets4 wavelets on all the levels of the image iv. Apply DCT compression on individual components RGB on each and every block. v. Apply histogram probability reduction function on RGB components using Mean intensities. vi. Apply Image quantisation sing q factor
20 Sharma and Kaur vii. Calculate probability index for each unique quantity. viii. Calculate unique binary code of Huffman code for each unique symbol. ix. Apply Huffman compression using Huffman tree. x. Calculate CR and PSNR. 3. MAJOR STEPS IN DETAIL In this section all the steps which are required for the medical image compression are proposed. 3.1 Image loading & resizing of image: In order to compress the image,the foremost step is to load the image and then the loaded sized into 256x256 format so to reduce the compression time. 3.2 Discrete wavelet Transform: For the compression of image,firstly the DWT is applied on the image using Thresholding value. Threshold values neglects the certain wavelet coefficients.for doing this one has to decide the value of threshold. Value of thresholf affects the quality of compresed image. Thresolding can be of two types: 3.2.1 Hard threshold: If x is the set of wavelet coeficients, then threshold value t is given by, T(t; x) = 0 if x < t x otherwise, i.e. all the values of x which are less than threshold t are equated to zero. 3.2.2 Soft threshold: In this case, all the coefficients x lesser than threshold t are mapped to zero. Then t is subtracted from all x t. This condition is depicted by the following equation: T (t; x) = 0 if x < t sign(x)( x - t) otherwise. This condition is shown in Figure 1(c). Usually, soft threshold gives a better peak signal to noise (PSNR) as compared to hard threshold In this paper we have used Hard Threshold. 3.3 Discrete Cosine Transform: DCT is applied separately on R,G and B components of the image.discrete cosine transform is applied on the compressed image to further compress the image by selecting the DCT threshold value to 200. We have fixed this value otherwise we can also vary this value to change the results. Then IDCT is applied on every component of the image. 3.4 Huffman compression for R, G and B: In the proposed compression method before applying Huffman compression, quantization is applied as it will give better results. In quantization, compression is achieved by compressing a range of values to a single quantum value. When the given number of discrete symbols in a given stream is reduced, the stream becomes more compressible. After the image is quantized, Huffman compression is applied. The Huffman has used a variablelength code table for the encoding of each character of an image where the variablelength code table is derived from the estimated probability of occurrence for each possible value of the source symbol. Huffman has used a particular method for choosing the representation for each symbol which has resulted in a prefix codes. These prefix codes expresses the most common source symbols using shorter
Sharma and Kaur 21 strings of bits than are used for less common source symbols. In this way, we have achieved a compressed image. 3.5 Calculation of CR and PSNR: After the image is compressed, last step is to calculate the CR and PSNR on different medical images. 3.6 To calculate CR :CR=((original sizecompressed size)/original size) * 100; 3.7 To calculate PSNR Peak Signal to-noise is the between the maximum possible power of a signal to the power of corrupting noise that affects the fidelity of its representation. 4. TEST RESULTS The test is performed on two different medical images of same size, brain (256x256) and lung (512x512) which are resized to 256X256. To show the results of involved parameters on the compression and peak signal-to-noise, different values of scaling factor (q) are used which affects the quantization steps for Huffman compression. Below tables show the varying CR and PSNR with the varying q for both the images. Brain image (256x256) Lung image (256X256) Original images used in Tests 4.1 Resulting parameters for the brain image with the varying Huffman quantization factor (q) Huffman quantization factor(q) Compression Peak signal-tonoise 2 19.41 48.78 3 26.47 46.59 4 31.84 45.45 5 35.88 43.77 6 38.84 42.60 7 41.66 41.40 8 44.21 40.46 9 46.44 39.53 10 48.19 38.69 Compressed image at q=2 Compressed image at q=5
22 Sharma and Kaur Compressed image at q=7 Compressed image at q=9 Resulted images for Brain with the varying Huffman quantization factor (q) 4.2 Resulting parameters for the lung image with the varying Huffman quantization factor (q) Huffman quantization factor(q) Compression Peak signal-tonoise 2 39.27 48.87 3 46.58 47.26 4 51.57 45.33 5 55.30 44.15 6 58.73 42.67 7 61.47 41.66 8 63.32 40.61 9 65.31 39.84 10 66.57 39.13 Compressed image at q=2 Compressed image at q=5 Resulted images for Lung with the varying Huffman quantization factor (q) 5. CONCLUSION AND FUTURE SCOPE In this paper a new hybrid scheme for medical image compression is proposed using hybrid of DWT, DCT and Huffman coding algorithm. This technique is tested against different medical images using different values of Huffman quantization factor. As the quantization factor increases the compression increases and the quality measurement (PSNR) decreases. Acknowledgement I would like to acknowledge and extend my heartiest gratitude to the following persons who have made the completion of this research paper possible. I am very thankful to the Head of the Department, Mr Danvir Mandal, for his encouragement, support and for providing the facilities for the completion of this thesis. This work would not have been possible without the encouragement and able guidance of my supervisor Ms Sarabjeet Kaur. Most especially to my family and friends. And to God, who made all things possible. References [1]. Ali Al-Fayadh et al, Second UKSIM European Symposium on Computer Modeling and Simulation IEEE 2008 Compressed image at q=7 Compressed image at q=9 [2] Mahmoud A. Mofaddel et al, Object based hybrid image and video coding scheme IEEE 2011.
Sharma and Kaur 23 [3]. Aree Ali Mohammed, Hybrid Transform coding scheme for medical image application IEEE 2011. [4]. XiHong ZHOU, Research on DCTbase Image Compression Quality Cross Strait Quad-Regional Radio Science and Wireless Technology Conference, IEEE 2011 [5]. Suchitra Shreshtha et al, Hybrid DWT- DCT Algorithm for Biomedical image and video compression applications. 10th International Conference on Information Science, Signal Processing and their Applications (ISSPA 2010) IEEE, 2010. [6]. Sunil Bhooshan, An efficient and selective image compression scheme using Huffman and adaptive Interpolation 24th International Conference Image and Vision Computing New Zealand (IVCNZ 2009) IEEE 2009 [7]. Chong Fu, A DCT based Fractal Image Compression method International workshop on chaos-fractals theories & Applications, IEEE 2009 [8]. Zhang Shi-qiang, The image compression method based on adaptive segment and adaptive quantified The 3rd International Conference on Innovative Computing Information and control, IEEE 2008.