Improvement of the compression JPEG quality by a Pre-processing algorithm based on Denoising Habiba LOUKIL HADJ KACEM, Fahmi KAMMOUN and Mohamed Salim BOUHLEL Research Group: Sciences, Image Technologies and Telecommunications High Institute of Biotechnology, Sfax; Tunisia Tel: (16)74.7.40.88 Fax: (16)74.7.55.95 Loukil_habiba@ voila.fr, medsalim.bouhlel@enis.rnu.tn Abstract: For communication and storage efficiency, image data should be substantially compressed. The compression ratio is limited by noise, which degrades the correlation between pixels. Noise can occur during image capture, transmission or processing, and may be dependent on or independent of image content. In this study, we use standard filters that permits to remove some details of the image and to reduce all possible noise. After filtering, the image is compressed with JPEG. By discarding the noise, the compression ratio can be improved. This method was verified using 5 images. This technique can increase the ratio without significantly affecting the image quality. This process will have a great impact on storage and transmission. Key words: JPEG, pre-treatment, filter, rwpsnr. 1.Introduction: In this setting, the present work carries on the optimization of the visual quality of the image rebuilt in a chain of JPEG compression, and that, while integrating a phase of pretreatment of the image while studying its influence on the process of compression (figure 1), in order to improve the image reconstitution quality and the compression rate. In a first stage, we tested the JPEG algorithm with images no treated before. Then, we introduced our filters to see the influence. In short, we must take account of the fact of the existence natural noise degrading the image that it is necessary to filter them before compressing. Initial Image Pretreatment Compression JPEG Figure 1: New process of treatment Compressed Image. Method: Three filters are used in this study to estimate the noise and evaluate the compression performance. These filters were Median [Fis 94], Smooth [Vas 98] and Wiener filter [ Kok 98a]. After been filtering, the image is compressed with JPEG and then computing the ratio from the compressed image using these three filters. We exanimate the performance of each filter by comparing the ratio with the classic compression JPEG..1. The noise: Images are often degraded by random noise which can occur during image capture, transmission or processing, and may be dependent on or independent of image content. Noise is usually described by its probabilistic characteristics. For discarding this noise, we used different types of filters... filtered image Images acquired through modern sensors may be contaminated by a variety of noise sources. Filtering images consists in suppressing the present noise in the image and that by studying, for every pixel, values of intensity on its neighborhood. Its main effect is the unification of image s parts in homogeneous zones. The image can be filtered very well in the frequency domain or in the spatial domain...1 Spatial filters: In the case of the spatial domain, filtering consists in achieving a discreet convolution of the picture to treat Ii(i,j) with the function of the H(m,n filter) while choosing the size of the mask to use. We make sweep the window of the filter on every pixel of the input image. Every position of the window corresponds to an output pixel. Practically, the function of the filter can be linear or no. In this study, we have used a linear filter: smooth filter and a non-linear filter: median filter. Smooth filter: The smooth filter tones down differences in adjacent pixels, resulting in only a slight loss of detail while smoothing the overall image or selected area [Vas 98]. The gray level of the central pixel is replaced there even by the average of levels of surrounding pixel included him while giving more importance to the nearest pixels. Median filter: The Median filter is normally used to reduce noise in an image. However, it preserves useful detail in the image. The median filter considers each pixel in the image in turn and looks at its nearly neighbors to decide whether or not it is representative of its surroundings. Instead of 1
simply replacing the pixel value with the mean of neighboring pixel value, it replaces it with the median of those values [Fis 94]... Frequency filters: Frequency filters process in image in the frequency domain. The image is Fourrier transformed, multiplied with the filter function and than re-transformed in the real domain. Attenuating high frequencies results in a smoother image in the real domain, attenuating low frequencies enhances the edges. All frequency filters can also be implemented in the spatial domain [Gon 9]. Frequency filtering is more appropriate if no straight forward mask can be found in the spatial domain. Wiener filter: The wiener filter is a class of optimum linear filters which involve linear estimation of a desired signal sequence from another related sequence. The Wiener filter is the MSE optimal stationary linear filter for images degraded by additive noise. Wiener filter are usually applied in frequency domain [ Kok 98a]. 3. Objective Assessments: Definition of the new quality index Objective image quality measures play important roles in various image processing applications. There are basically two classes of objective quality or distortion assessment approaches. The first are mathematically defined measures such as the widely used mean squared error (MSE), peak signal to noise ratio (PSNR) and signal to noise ratio (SNR). The second class of measurement methods considers human visual system (HVS) characteristics in an attempt to incorporate perceptual quality measures [Pap 00]. Unfortunality, none of these uncomplicated objective metrics in the literature has shown any clear advantage over simple mathematical measures such as PSNR under strict testing conditions and different image distortion environments [Mar 98], [Vqe 00], [Esk 95]. Mathematically defined measures are still attractive because of two reasons. First, they are easy to calculate and usually have low computational complexity. Second, they are independent of viewing conditions and individual observers. Let X ={xi i=1,,,n} and Y={yi i=1,,,n} the original and the test image signals, respectively. 3.1. The wpsnr: Although the PSNR quantifies the intensity of the distortion, it doesn't adjust to the dynamic characteristics of the image. Indeed, the deterioration is more visible in zones few textured (to weak variance) and less visible in zones more textured (stronger variance) [Tri 0]. Of this fact, we took account of the image variance. It increases when the variance is big and decreases in the contrary case. We will have a new definition of the MSE that would be in this case: M 1 1 1 N wmse = MN m= 0 n= 0 ( x y 1+ Var( m, n) ) 3.. The rwpsnr: As complement of the wpsnr, we introduce the relative wpsnr "relative weighted PSNR" rwpsnr that takes account of the relative difference of the image gray levels [Nad 00a]. Indeed, the difference of intensity (10) brings in two pixels of values respective 10 and 0, is numerically the even that the one brings in a couple of pixels of values 110 and 10. However on the visual plan the perception differs. It calls us therefore to think about the necessity to introduce the relative difference notion in the calculation of the wpsnr from where the rwpsnr [Lou 04b]. rwpsnr=10 max Log10 rwmse So we have a new definition of the MSE noted rwmse that is in this case: x x y )/( x y ) 1+ Var( m, n M 1 1 1 ( N * + rwmse= MN ) m= 0 n= 0 The dynamic range of rwpsnr is [0, infini]. The greatest the value is the best the quality it is. The best value infinite is achieved if and only if Y=X. The lowest value of 0 occurs when Y is completely different to X. This quality metric models any distortion as a combination of two factors: relative luminance distortion and the dynamic of the image (variance). 4. Subjective Assessments: Because of the diversity of image types and their contents, the objective assessment of the quality is often insufficient. In this case, a subjective assessment becomes necessary. This subjective assessment concerns the type of deteriorations in general, as the preservation of contours and textures, the presence of a block effect, the image smoothing, the masking of details, etc Besides, the subjective assessment permits to validate the metrics used as perceptive metrics that takes account of the human visual system, because the success of the final measure depends on the SVH model validity and the applied distortion measure in perceptual domain. Indeed, besides the difference studied measures to value the image quality, the human eye is the first judge capable to either appreciate not to appreciate this quality. This human faculty is used to qualify the visual character of an image and to sequence a whole of images in relation to criteria of quality. Thus, the application of psychovisuals tests permits to value the quality of compression algorithms, and to judge the character natural of an image or to judge of intrinsic manner a whole of images.
5. Comparison of results 5.1. Quantitative assessment of results: In our work, we applied three filters (smooth, median and wiener) on our test images then we compressed them with the JPEG norm. A quantitative Tab 1: table of values rwpsnr=f(nbpp) assessment in term of rwpsnr is achieved to compare the compression with and without pre-filtering according to the number of bit by pixel. (Curves rwpsnr = f(nbbp)) nbbp 0.5 1 1.85 3 3.5 rwpsnrs 94.4 100. 103.15 104.9 106.05 rwpsnrp 95.6 101.9 104.9 106.95 107.4 smooth Filter nbbp 0. 0.4 0.36 0.41 0.8 rwpsnrs 94.9 98.8 101 103.35 105.9 rwpsnrp 96.4 100.7 103.40 104.6 106.40 Wiener Filter nbbp 0. 0.5 0.3 0.43 0.55 rwpsnrs 104.7 106.7 108.1 109.7 111,1 rwpsnrp 106.8 108.15 109.8 110.9 111.98 nbbp 0.5 0.5 0.7 1 1.5 rwpsnrs 96.05 100.1 101. 105.8 107.65 rwpsnrp 97.98 101.5 105.85 108 111 Filter smooth nbbp 0.49 0.9 1.4.1 3.4 rwpsnrs 93.7 98.4 101.7 103.4 105.8 rwpsnrp 94.9 101.6 103.3 105.85 107 median Filter nbbp 0.5 1 1.5..65 rwpsnrs 107. 110.6 11.15 113.6 114 rwpsnrp 108 11.05 113.9 115 115.6 nbbp 0.35 0.7 0.8 1.5 1.75 rwpsnrs 95.7 101.0 104.4 107.5 108.6 rwpsnrp 98.81 103 107.30 108.3 110 nbbp 0.3 0.4 0.5 0.7 0.8 rwpsnrs 95.87 96.0 101.0 101.40 104. rwpsnrp 98. 98 104.08 103.8 105. Tab : Curves rwpsnr=f(nbpp) smooth Filter median Filter 3
Wiener Filter Filter smooth While applying the various mentioned filters, we find that the pre-filtering improves distinctly on the compression of images. The curve of the rwpsnr with pre-filtering (in Red) is to the over of the one without pre-filtering (in blue). have the same rate of compression but quantification factors (q) different. 5.. Assessment of the visual quality of images: The following images are compressed with JPEG with and without pre-filtering. They 4
Tab 3: Quality of images compressed with and without pretreatment Without pretreatment (number of bit by pixel =1.5 ) With pretreatment (number of bit by pixel =1.5 ) Without pretreatment (number of bit by pixel =1) With pretreatment (number of bit by pixel =1) Without pretreatment (number of bit by pixel =) With pretreatment ( number of bit by pixel=) 5
6. Conclusion: The interest of this work was to find a technique of pre-treatment that permits to optimise the JPEG algorithm. Indeed, we tried to improve the quality of compression by the introduction of different type of filter. The comparison of results showed that the integration of filtering in a phase of pre-treatment gives good results on the used pictures, being given that the quality of the picture resists the very rate of compression. NB: rwpsnrs: rwpsnr without pretreatment. rwpsnrp: rwpsnr with pretreatment. References: [Esk 95] A.M.Eskicioglu and P.S. Fisher, "Image quality measures and their performance, "IEEE Trans. Communications, vol.43, pp.959-965, Dec.1995. [Fis 98] Bob Fisher, Simon Perkins, Ashley Walker and Erik Walfart, Hypermedia Image Processing (1994). Department of Artificial Intelligence, University of Edinburgh UK. [Gon 98] R.Gonzalez and R.Woods Digital Image Processing Addision, Wesley Publishing Company, 199, Chap4. [ Kok 98a] A.C. Kokaran, Motion Picture Restoration: Digital Algorithms for Artifact Supression in Degrated Motion Picturefilm and Video, Springer- Verlog, April 1998. [Lou04b] Habiba.Loukil Hadj Kacem, Mohamed Salim Bouhlel, Lotfi Kamoun,"Image Quality Metric Using System Visual Human Characteristics". 8th World Multi-Conference on Systemics, Cybernetics and Informatics July 18-1, 004 - Orlando, Florida, USA. [Mar 98] J.-B. Martens and L.Meesters, "Image dissimilarity," Signal Processing, vol.70, pp.155-176, Nov.1998. [Nad 00a] M.J.Nadenau, S. Winkler, D. Alleysson, and M. Kunt. "Humain Vision Models for perceptually optimized image processing- a review". Submitted to Proceeding. [Pap 00] T.N.Pappas and R.J. Safranek, "Perceptual criteria for image quality evaluation, " in Handbook of Image and Video Processing (A.C. Bovik, ed.), Academic Press, May 000. [Tri 0] H.Trichili, M.S.BOUHLEL, L.Kamoun, "Contribution aux Mesures Efficaces de l Imperceptibilité du Tatouage et Nécessité de l Introduction d un masque psychovisuel", th Scientific days in Electric and Informatic Genius GEI 00). Hammamet, Tunisi0, 5-7 Mars 00 [Vas 98] Vasilyev, O.V., Lund,T.S. and Moin, P. (1998) A General Class of Commutative filters, J.Comp. Phys, 146, pp.105-13. [Vqe 00] VQEG, "Final report from the video quality assessment," the validation of objective models of video quality measures and their performs http://www.vqeg.org/,mar.000 6