International Journal of Wavelets, Multiresolution and Information Processing c World Scientific Publishing Company IMAGE MIRRORING AND ROTATION IN THE WAVELET DOMAIN THEJU JACOB Electrical Engineering Department, University of Texas at Arlington Arlington, Texas 76019, USA theju.jacob@mavs.uta.edu K. R. RAO Electrical Engineering Department, University of Texas at Arlington, Box 19016 Arlington, Texas 76019, USA rao@uta.edu DO NYEON KIM Electrical Engineering Department, University of Texas at Arlington, Box 19016 Arlington, Texas 76019, USA dnkim@uta.edu Received (20 October 2008) Revised (Day Month 2008) Communicated by (xxxxxxxxxx) JPEG2000, the international standard for still image compression, uses wavelet transform. The filters used by JPEG2000 for transformation are the 9/7 Daubechies filter and the 5/3 Le Gall filter. In this paper, we present a method for image mirroring and rotation in the wavelet domain, by manipulating the transformation coefficients. Our technique requires no additional complexity and the perfect reconstruction property is preserved. Keywords: Mirroring; Rotation; JPEG2000 filters; Wavelets. AMS Subject Classification: 22E46, 53C35, 57S20 1. Introduction JPEG2000, 1 the still image compression standard which resulted from the joint efforts of International Telecommunications Union (ITU) and International Organization for Standardization (ISO), uses wavelet transform. The image undergoes forward transform, quantization and entropy encoding on its way to the compressed format. To reconstruct the original image, we have to apply entropy decoding, inverse quantization and inverse transform. Consider the case where image information is available in the transform domain. In order to obtain a mirrored or rotated image, we have to apply inverse transform 1
2 T. Jacob, K. R. Rao and D. N. Kim first and then proceed with our operations in the spatial domain. This constraint can be avoided by simple reordering of the transform domain coefficients of the original image for the mirrored or rotated image. Image mirroring and rotation in transform domain for transforms such as DCT and DST have already been implemented 2,3,4,5. In DCT, for example, mirroring involves a sign change of alternate transform coefficients 2,3. Rotation of the transform coefficient matrix leads to rotation of the reconstructed image by various angles. This paper discusses a method to obtain wavelet transform domain coefficients of the mirrored/rotated image from those of the original image, thereby doing away with the necessity of having to retrieve the original image first. The methods described here do not add further computational complexity. This paper is organized as follows. Section 2 discusses the property of perfect reconstruction of filter banks. Section 3 discusses how we can manipulate the transform coefficients while retaining the perfect reconstruction property. Section 4 shows the results. We conclude in Section 5. Fig. 1. A simple two-channel filter bank. 2. Property of Perfect Reconstruction Let us consider a two-channel filter bank as shown in Fig. 1. On the analysis side, let H 0 and H 1 bethelowpassandhighpassfilters, respectively. On the synthesis side, let F 0 and F 1 be the low pass and high pass filters, respectively. The product filter P m (ω) isthengivenby: P m (ω) =H m (ω) F m (ω) (2.1) where m =0, 1. To be able to reconstruct the image from wavelet coefficients, we require that the filters satisfy the properties of perfect reconstruction 6, according to which the product filter should form a half band filter. That is, the product filter P (ω) should satisfy: P (ω)+p (ω + π) = 2 (2.2)
Wavelet Domain Image Mirroring and Rotation 3 2.1. The idea Let X (ω) represent our signal in the frequency domain. Then after filtering and downsampling in the analysis side, we obtain: Y m (ω) = 1 [ ( ω ) ( ω ) H m X m 2 ( 2 2 ω ) ( ω )] +H m 2 + π X m 2 + π (2.3) where m =0, 1. If we flip our results in the spatial domain, we would get the expression: Y m (ω) = 1 ( [H m ω ) ( X m ω ) 2 ( 2 2 +H m ω ) ( 2 + π X m ω )] 2 + π (2.4) where m =0, 1. Equation (2.4) can be looked upon as filtering of reverse sequence by reverse analysis filters. In order to maintain the conditions of perfect reconstruction, and obtain the reverse sequence as our final output, we can reverse our synthesis filters as well and proceed with the synthesis. This is equivalent to saying that reversing input and the filter would produce the output in reverse. Next, consider the case where the analysis and synthesis filters are symmetric, as is the case in JPEG2000 9/7 and 5/3 filters 1. For symmetric filters, coefficients in the forward and reverse orders are the same, i.e., H m (ω) =H m ( ω) (2.5) for m =0, 1. In this case, by replacing H m (ω) withh m ( ω) wecanview(2.4)as filtering of reversed input by the analysis filter bank. Hence, we can continue with our synthesis without having to reverse the synthesis filters. 3. Mirroring and Rotation Fig. 2. Analysis filter bank.
4 T. Jacob, K. R. Rao and D. N. Kim Fig. 3. Synthesis filter bank. Let LL, LH, HL and HH be the four components/matrices obtained by passing an image through the two-channel analysis filter bank, where each component denotes the output of a particular branch in the analysis filter bank (Fig. 2). Now, in the synthesis bank, let LL, LH, HL and HH denote the branches which accept the four components, LL, LH, HL and HH, respectively (Fig. 3). Let 0 0 1 J =.. 1 0 (3.1) 0... 1 0 0 be a reverse identity matrix of the same dimension as LL, LH, HL and HH components or matrices. The mirrored and rotated images can be constructed as explained below. 3.1. Mirroring In the case of horizontal mirroring, we simply reverse each of the components LL, LH, HL and HH and apply it to the synthesis filter bank, i.e., we postmultiply each component matrix by the matrix J and then give it to the filter bank. For vertical mirroring, we premultiply each of the components by J instead of postmultiplying. Figures 4 and 5 show the synthesis filter banks for horizontal mirroring and vertical mirroring, respectively. Each of the synthesis filter bank block accepts four inputs and generates a reconstructed image as output. 3.2. Rotation For clockwise image rotation by 90 degrees, we premultiply each component in the transform domain by J (vertical mirroring), transpose it, and then apply it to the synthesis filter bank. One point to be noted is that, here, (J LH) T is given to HL and (J HL) T is given to LH.
Wavelet Domain Image Mirroring and Rotation 5 Fig. 4. Horizontal Mirroring. Fig. 5. Vertical Mirroring. For clockwise image rotation by 270 degrees, we adopt a similar step - the only difference is that here we postmultiply each component by J (horizontal mirroring) instead of premultiplying. The step of giving the input from LH branch to HL and input from HL branch to LH is required because, for 90 and 270 degrees, we are transposing the image matrix, and so for retrieving the image, the rows and columns have to be given to those branches with filters which holds the properties of perfect reconstruction with the filters that created the rows and columns. For 180 degrees on the other hand, we simply have to premultiply and postmultiply by J, each of the four components, and apply them to the synthesis filter bank. Figures 6, 7 and 8 represent clockwise image rotation by 90, 180 and 270 degrees, respectively.
6 T. Jacob, K. R. Rao and D. N. Kim Fig. 6. Rotation by 90 degrees. Fig. 7. Rotation by 180 degrees. Fig. 8. Rotation by 270 degrees. 3.3. Analysis Horizontal mirroring example In this subsection, we analyse the logic behind the operations performed at the input of the synthesis filterbank. As an example we prove that input to LH in
Wavelet Domain Image Mirroring and Rotation 7 Fig. 4 will be same as the component LH of a horizontally mirrored image. Let x be the input image, the analysis of which would give us LL, LH, HL and HH components, each with a dimension of M N. First consider the expression for the component LH of the original image. It is given by: Y lh [m, n] = h 0 [k] h 1 [l] x [2m l, 2n k] (3.2) k= l= On postmultiplying LH by J, we obtain, Y [m, n] =Y lh [m, N 1 n] = h 0 [k] h 1 [l] k= l= x [2m l, N 1 2n + k] (3.3) Next consider the component LH for the horizontally mirrored image, xj. Itis given by Y [m, n] = h 0 [k] h 1 [l] k= l= x [2m l, N 1 2n + k] (3.4) Since h 0 [k] is a symmetric filter, h 0 [k] =h 0 [ k], the above equation can be written as Y [m, n] = h 0 [k] h 1 [l] k= l= x [2m l, N 1 2n + k] (3.5) Since (3.5) is equivalent to (3.3), the operationsperformedon thewaveletcoefficients of the original image is justified. Similarly, all the input operations performed on several synthesis filter banks considered can be analyzed. 4. Results We applied the proposed methods for both Daubechies 9/7 and Le Gall 5/3 filters. The wavelet coefficients obtained using these JPEG2000 filters were subjected to the appropriate operations as discussed in the previous section. The resulting figures are shown in Figs. 9 and 10. In Fig. 9, we used the 9/7 Daubechies filters for the transformation. The original Lena image is shown, along with the results for mirroring and clockwise rotation. Top left - horizontal mirroring, top center - rotation by 180 degrees, top right - rotation by 90 degrees, bottom left - vertical mirroring and bottom right - rotation by 270 degrees.
8 T. Jacob, K. R. Rao and D. N. Kim In Fig. 10, we used the Le Gall 5/3 filters for the transformation. The Girl image is shown, along with the results for mirroring and clockwise rotation. As was the case for Lena image, top left - horizontal mirroring, top center - rotation by 180 degrees, top right - rotation by 90 degrees, bottom left - vertical mirroring and bottom right - rotation by 270 degrees. Fig. 9. The Lena image with 9/7 Daubechies filter coefficients. Top left horizontal mirroring, top center clockwise rotation by 180 degrees, top right rotation by 90 degrees, bottom left vertical mirroring, bottom right rotation by 270 degrees. 5. Conclusion We presented techniques for achieving image mirroring and rotation for JPEG2000 without having to convert the image back to spatial domain in the first place. This gives us the option of processing the transform coefficients directly without having to do the inverse transformation. We have shown the results on two images for both mirroring and rotation, using the Daubechies 9/7 as well as Le Gall 5/3 filters. Acknowledgments The first author would like to acknowledge Dr. Pramod Lakshmi Narasimha, FastVDO Inc., for assistance during the preparation of the paper. References 1. A. Skodras, C. Christopoulos, and T. Ebrahimi, The JPEG2000 still image compression standard, in IEEE Signal Processing Magazine, vol. 18, pp. 36 58, Sept. 2001.
Wavelet Domain Image Mirroring and Rotation 9 Fig. 10. The Girl image with 5/3 Le Gall filter coefficients. Top left horizontal mirroring, top center clockwise rotation by 180 degrees, top right rotation by 90 degrees, bottom left vertical mirroring, bottom right rotation by 270 degrees. 2. B. Shen and I. K. Sethi, Inner-block operations on compressed images, in Proc. of the Third ACM International Conference on Multimedia, pp. 489 498, San Francisco, CA, Nov. 1995. 3. R. L. de Queiroz, Processing JPEG-compressed images and documents, IEEE Transactions on Image Processing, vol. 7, pp. 1661 1672, Dec. 1998. 4. D. N. Kim and K. R. Rao, Sequence mirroring properties of orthogonal transforms havingevenandoddsymmetricvectors,ecti Transactions on Computer and Information Technology, vol. 3, no. 2, Nov. 2007. 5. D. N. Kim and K. R. Rao, Two-dimensional discrete sine transform scheme for image mirroring and rotation, Journal of Electronic Imaging, vol. 17, Jan. Mar. 2008. 6. G. Strang and T. Nguyen, Wavelets and FilterBanks (Wellesley-Cambridge Press, 1997). 7. S. K. Mitra, DigitalSignalProcessing(Tata McGrawHill, 2006).