Tile of paper Zooming Image Using Inverse Slantlet Transfor Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 - 65 (2009) Image Zooming Using Inverse Slantlet Transform Ahlam Hanoon Department of Computer Engineering/ Collage of Engineering/ University of Baghdad Email:ahlam@yahoo.com (Received 28 September 2008; accepted 2 June 2009) Abstract Digital image is widely used in computer applications. This paper introduces a proposed method of image zooming based upon inverse slantlet transform and image scaling. Slantlet transform (SLT) is based on the principle of designing different filters for different scales. First we apply SLT on color image, the idea of transform color image into slant, where large coefficients are mainly the signal and smaller one represent the noise. By suitably modifying these coefficients , using scaling up image by box and Bartlett filters so that the image scales up to 2X2 and then inverse slantlet transform from modifying coefficients using to the reconstructed image . From the simulation result, it has been found that the reconstructed image is 2X2 larger than the image that found from the inverse without scaling up the coefficients. Comparison of image zooming using inverses SLT by box and Bartlett filters, found that, because of the linear interpolation done by using Bartlett the image appears to be smoother than the image obtained using a box filter. The performance of these techniques (image zooming using inverse SLT) has been evaluated by computer programs with MATLAB 7.04 (R2007a) language. Keywords: DWT, SLT, ISLT, SCLIM, bOX filter, Bartlett filter, Image Zooming. 1. Introduction Discrete wavelet transforms (DWT , s) are useful in a variety of applications (such as estimation ,compression ,and fast algorithms), partly, because they can provide a relatively efficient representation of piecewise smooth signals. The degree to which a wavelet basis can successfully yield sparse representations of such signals depends on the time localization and on the smoothness properties of the basis function [1]. For example, signal smoothing by non linear shareholding of DWT coefficients preserves edges reasonably well – in part, because the support of each basis function is short with respect to its bandwidth, (thus, we have" constant Q'' behavior, or octave – band characteristic , of the associated filterbank) [2,3]. A fundamental Tradeoff exist between time localization and smooth characteristic is desirable to obtain a good tradeoff between these two competing criteria in designing wavelet bases. As it is usual for DWT , s, in the slantlet transform the length of the discrete – time basis function and their moments are the vehicles by which time localization and smoothness properties are achieved. Although the usual filterbank iteration provides a simple way to general an orthogonal discrete – time basic having an octave-band characteristic. For a fixed number of zero moment, it does not yield a discrete-time basis that is optimal (with respect to time localization [2]. Selesnick [2, 3] described the basis functions of slant transform from a filterbank view point, gave explicit solution for the filter coefficients, and described an efficient algorithm for the transform. The DWT described in this paper is based on filter bank structure whose different filters are used for each scale. Nevertheless, a very simple efficient algorithm based or recursion is available. In the DWT filter bank described here, the support of the discrete-time basis functions is Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 55 reduced (by a factor approaching one third for coarse scales). Which retaining the basic characteristic that leads clearly to a DWT for finite length signal, (boundary issues do not arise, provided the data length is a power of (2). The filterbank is piecewise linear but is discontinuous. For coarse scales, the converge to piece-wise linear discontinues function. The basis being piecewise linear, is reminiscent of the slantlet transform to which it is compared. However the basis function of the slantlet, like the Hadamard transform for example, is nonzero over all of the domain, where the basis functions described there become progressively more narrow, giving a multiresolution decomposition. Hence,Selenick has the name of slantlet for the transform described here. Thus slantlet basis appears especially well suited for treating piecewise linear signal. 1.1. Image Zooming Image zooming is defined as the increase or the reducing of the image size by a fixed ratio. Two properties of scaling (zooming) make implementation of scaling easier than that of a general warp transformation. • Although pixel distance is not preserved, the expansion or contraction ratio is the same every where. • If the scaling ratio is an integer, the pixel lattice of the target image is a subset or suprest of the lattice of the original image. The first property allows the use of spatially invariant filters and the second property avoids the need for resampling when the scaling ratio is an integer. For the case of scaling up (image enlargement), the methods used involve first resizing the image by padding with zeros, followed by convolution with a two-dimensional spatially invariant linear filter. Each filter can be represented by the impulse function, which is called the mask of the filter. Two common filters, the box filter and Bartlett filter, are used in the enlargement of both grayscale and color images [4]. 2. Slantlet Transform The slantlet transform is an orthogonal discrete wavelet transform with two zero moments and with improved time localization. The construction of the slantlet is based on a filterbank structure where different filters are used for each scale. Let us consider a usual two scale iterated DWT filter shown in figure (1) and its equivalent from figure (2). Fig. 1. Two-Scale Iterated Filter Bank DWT Fig. 2. Equivelant Form Using DWT The slantlet filterbank employs the structure of the equivalent form shown in figure (2) but it is occupied by different filters that are not produced with this extra degree of freedom obtained by giving up the product form. Filters of shorter length are designed to satisfy the orthogonality and the zero moment condition [1]. For the two- channel case, the Daubechicies filter is the shorter filter which makes the filterbank orthogonal and has K zero moments. For K=2 zero moments the iterated filter of figure (2) is of length 10 and 4 but the slantlet filterbank with K=2 zero moment shown in figure (3) has filter length 8 and 4. Thus the two-scale slantlet filter length is two samples less than that of a two-scale iterated Daubechies-2 filterbank. This difference grows with the increased number of stages. Some characteristic features of the slantlet filterbank are orthogonal, having two zero moments and octave-band characteristic. Each filterbank has a scale dilation Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 56 factor of two and provides a multiresolution decomposition, the slantlet transform filter are piecewise linear, even though there is no true structure for slantlet it can be efficiently implemented like an iterated DWT filterbank. Therefore, computation complexities of the slantlet are of the same order as that of the DWT, but slantlet transform gives better performance in denoising and compression of the signals [2]. Fig. 3. Two-Scale Filterbank Using SLT. 2.1. Derivation of the Slantlet Filter Coefficients [2]. The filter that constructs the slantlet filterbank is gi(n), fi(n) and hi(n). The L-scale filterbank has 2L channel. The low-pass filter is to be called hL(n). The filter adjacent to the low-pass channel is to be called fL(n). Both hL(n) and fL(n) are to be followed by downsampling by 2 L . The remaining 2L-2 channels are filtered by gi(n) and is shifted time-reverse to i=1,…..,L-1. Each is to be followed by down/sampling by 2 i+1 . The sougth filter gi(n) is described by four parameters and can be written as     1 1i ,...,2 i 2n 2 1 1 i 0,...,2nfor 1          for i nbob naoa nig … (1) To obtain gi(n) that sougth L-scale filterbank is orthogonal with 2 zero moment, requires obtaining the parameters ao,a1,bo,b1 m=2 i ))14)(1/((6 22 1  mmms ))1(*/(32 2 1  mmt 2/)1(1  mss o )*2)(1)(1*3/(*)1(( 1 mmtmsmt o  2/)( ooo tsa  2/)( ooo tsb  2/)( 111 tsa  2/)( 111 tsb  The same approach is for fi(n) and hi(n).             1 1 2,..., i 2nfor 2 1 1 i 0,...,2nfor 1 ii nbob naao nih … (2)             1 1 2,..., i 2nfor 2 1 1 i 0,...,2nfor 1 ii ndod ncoc nif … (3) m=2 i mu /1 3/)12( 2  mv )2/()1(* mvua o  )2/()12(* mvmub o  mua / 1  ab  1 mmmq /))1(*/(3 2  )(* 1 mvqc  )(* 1 mvqd  2/)*21(* 1 mvdd o  2/)1(* 1  vcc o 2.2. Two-Dimensional Filter banks A 2-D filterbank can be obtained in a similar manner to the iterated wavelet banks that is composed of separable filters ,although the filterbank itself is not separable. The 2- D slantlet transform (2-D SLT) of a signal can be obtained by performing 1-D slantlet transform on the row followed by another slantlet transform to the columns as shown in figure(4). In a similar manner, the 2-D inverse slantlet transform (2-D ISLT) of a signal can be found by applying (1-D ISLT) on the rows followed by another (1-D ISLT) to the columns as shown in figure (5). Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 57 Fig.4. Scale-Two, Two Dimension SLT Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 58 Fig.5. Scale-Two, Two Dimensions ISLT 2.3. Generation of Slantlet Matrix [5,6]. To generat slantlet matrix for a size of [2 L X 2 L ] by using eq.(1),eq(2)and eq(3) we get gi(n),hi(n),andfi(n) L n 2,.....2,1      L LL nhnhnT 2,1       L LL nfnfnT 2,2  1,...,1 Li 1 2,.......,1   i n   11*22   Kq iL     ngKnqT i i   1*, 1     ngKnqT i i i   121*2,1 11 The slantlet transform of the input signal is x(n).      nxnKTky L n    12 0 , The inverse slantlet transform can be computed as shown      KYKnTnx L k    12 0 , Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 59 3. Zooming Method Image zooming involves scaling up or scaling down the typically massive amount of data needed to represent an image. Image processing is being used to enable people to see what they will look like with a new haircut, a new pair of eyeglasses. 3.1. Scaling up This is done by rows an columns that are necessary to enlarge the image without changing it. There are two common methods padding and convolution methods. 3.1.1. Padding The initial step in scaling up an image is to make the size right. This is done by padding the enlargement matrix with zeros. Starting by inserting a row of zero ' s at the top and one after each row of the original image, will get the image obtain 2n+1 rows if the original had n rows. The same thing can be done for the columns. Assume we have 2x2 matrix as below:        1,1,1 1,,   jifjif jifjif Zero-padding for a 2 by 2 expansion leads to        1,101,1 000 1,0,   jifjif jifjif If the original image had n rows and m columns, and we want to scale it up by a factor X in the horizontal direction and Y in the vertical direction, then the zero-padding image will have X*n+1 rows and Y*n+1 columns. 3.1.2. Convolution The second step is convolution of zero matrix with 2-D, The function of circular convolution using matlab, is shown in the following:- function t=circonv(fil,x) % CIRCONV(fil,x) performs the circular convolution of x with filter fil. % fil(1) is the offset and fil(2:end) are the nonzero filter coefficients % for h=fil(2:end); offset=fil(1); n=length(h); t=zeros(size(x)); for i=0:n-1 t=t+h(i+1)*downshift(x,i); end t=downshift(t,offset); 3.2. Box-Filter This is known as scaling by pixel replication. Because each row is replaced by a number of identical rows and likewise for columns. This is achieved by applying a box interpolation filter. For scaling an image by a factor two in both horizontal and vertical direction Use result from image padding and convolve with the box filter of order two, which has mask       11 11 If the original image has n rows, this leads to an image with 2n row, as shown in the following:                               1,1,1,1 1,,, 1,,, jifjifjif iifjifjif jifjifjif Hence the rows of zero , s have been replaced with a copy of a pixel values directly above them, and the columns zero , s look on the values of the pixel to their immediate left. Note that this convolution Kernel has a total mass of four, but since the image had been enlarged four times by zero-padding, the average intensity of the convolution results remains equal to that of the original. 3.3. Bartlett Filter Similar to the box filter, a Bartlett can also be applied to scale an image. The effect of convolving a padding image with Bartlett filter is Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 60 to insert between each two consecutive rows of the original image a new row that is the average of the two, and likewise for the columns. In other words, we perform linear interpolation between rows and columns independently. Because of this linear interpolation done by using the Bartlett filter, the image appears to be smoother than the image obtained using box filter .Barlett matrix can be constructed by taking the dot product of row(r) and column(c) and multiply the dot product of(r) and (c) by1/ (scale _factor_ X*scale_factor_Y).this is done because the sum of all elements in the resulting dot product is always (scale_ factor_ X*scale_ factor_ Y) greater than the desired intensity. For example, in the case of scaling 2X in both horizontal and vertical direction, each pixel is mapped into 4 pixels. In the resulting image we want the intensity to be four times greater than that of the original image in order to maintain the same average intensity level. Thus, we want the mass of the Bartlett filter to be 4. 4. The Proposed System Design Image zooming using inverse slantlet transform implements image scaling base on scaling up of slantlet matrix then taking inverse slantlet transform, we apply on color images. The type of images used in this work are JPG. 4.1. System Functions The function of simulation of scaling up using inverse slantlet transform (color image) of eight- scale filterbank is summarized by the following steps:- Input: image data. Step1: Read image data. Step2: Call the slantlet transform algorithm, to generate slantlet matrix (Sec. 2.3 above), then scaling up transform coefficients using box & Bartlett filters. This is to modifying slantlet matrix. Step3: Call the inverse slantlet transform algorithm as in step 2, and multiply the modified transpose slantlet matrix by the result of step 2. The above steps are called image encoder as shown in figure. (6). Fig.6. Image Encoder Output: The output image appears after scaling up using inverse slantlet transform from modifying the slantlet coefficients by two common methods box and Bartlett filters. Step4: Reconstruct the enlarged image from the new coefficients using the inverse slantlet transforms as in step3. Step5: Display the result images into a memory space. The above steps are called image decoder as shown in figure (7). Fig.7. Image Decoder Hint: applying the ideas of image zooming using inverse slantlet transform of the color image, which is represented by three matrices represent R,G,and B color planes. The first image is separated into this R,G,and B matrices. Apply the image zooming using inverse slantlet transform algorithm described above on each matrix, and then combine the results. 4.2. Computer Test A general computer program computing the two dimension slantlet transform is written using MATLAB 7.04 for a general NXN 2-D (image). An example of a test is applied to "sunset" picture figure (8). Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 61 Fig.8. The Original Image Using the computer program of the proposed method for computing slantlet transform with scale L of eight Take 2-D after resize it to power of two [256x256]. The slantlet transform is taking in row wise then in column wise. In this step the image is decomposed to slantlet coefficients. Then taking inverse slantlet transforms the result image is shown in figure (9). Fig.9. Image Using ISLT Applying the scaling up to the slantlet coefficients; then taking the inverse slantlet transform for modifying slantlet matrix by box &Bartlett filters the result is shown in figure (10)and figure (11). Fig.10. Enlarge Reconstructed Image by Box filter. Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 62 Fig.11. Enlarge Reconstructed Image by Bartlett filter. Figure (12) represents a pictures that is used for testing of image zooming by inverse slantlet transform using box filter and the enlarge pictures are shown in figure.(13). Also in the same way a picture that is used for testing image zooming by inverse slantlet transform using Bartlett filter and enlarge picture is shown in figure (14). Fig.12. The Original Image Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 63 Fig.13. Enlarge Reconstructed Image by Box Filter. Fig.14. Enlarge Reconstructed Image by Bartlett Filter. 5. Conclusions Slantlet transform plays an important role in image applications. Due to this multiresolution analysis makes the statistic of many natural images be simplified when they are decomposed. It takes the idea of iterated wavelet decomposition with less length filterbank and without any pre/post processing mechanisms. Slantlet transform is an orthogonal DWT and provides improved time localization than DWT. The slantlet filter is piecewise linear, for 2 i *2 i image Ahlam Hanoon Al-Khwarizmi Engineering Journal, Vol. 5, No. 2, PP 54 -65 (2009) 64 reaching the ith wavelet decomposition stage that can be done with linear operations without the need to perform an iterated filterbank operations as in wavelet. So from the point of view program, computations of the time of the number of multiplication/ adding operations is reduced and the result can be very fast. SLT is less frequency selective than the-traditional DWT filterbank due to the shorter length of the filters. The time localization is improved with the degradation of frequency selectivity. Enlarge the slantlet matrix using two common methods box and Bartlett filter and taking inverse slantlet transform to modify the matrix. The following points can be concluded from these methods:- 1- The combination of slantlet transform and scaling up gave good results in comparison with the used scaling up method individual. 2- The transformation of the image signal from time domain to time-frequency domain gives better results than that of the transformation to frequency domain. 3- The slantlet transform gives good result in the image which contains large smooth region because it has linear filter which works well in linear data and the data in the smooth region is linear. 4- The designed system can deal with binary image, gray image as well as color image. 6. References [1] G Panad, P.K. Dash, A.K. Pradhan and S.K. Mehar, "Data Compression of Power Quality Events Using the Slantlet Transform ". IEEE. Transaction on power Delivery, vol.17.2, April 2002. [2] I.W Selesenick. "Discrete Wavelet Transform of Aaproximation Order 2 With Improved Time Localization-The Slantlet Transform" Polytechic University–Electrical Engineering. GMetrotech Centre Brooklyn, NY 11201- 3840, 1998. [3] I.W Selesnick, "The Slantlet Transform", IEEE.Tranction on Signal Processing, Vol.47, No. 5, MAY 1999. [4] Peter Chien and Emily Kwok. Psych 221/ EE 362 project: Image Scaling. Prof.Brian Wandell Winter 1999. [5] Mohammed Hazim Abdul – Kareem "Optimum Technique for Data File Denoising". M.Sc. Thesis University of Baghdad, Collage of Engineering, Electrical Eng. Dept. June 2007. [6] Abbas Hussien Miry "Image Compression Using Slantlet Transform", M.Sc. Thesis University of Baghdad, Collage of Engineering, Electrical Eng. Dept. June 2007. 65 - 54، صفحت 2، العذد 5مجلت الخوارزمي الهنذسيت المجلذ احالم حنون شنيه (200 9) 65 تكبير الصورة باستخذام التحويل المويل المعاكس احالم حنون شنيه جايعح تغذاد / كهيح انهُذسح/لسى هُذسح انذاسثاخ الخالصت يرى اوال اسرخذاو ذذىيم انًىيم نًا يرصف تح يٍ . هزا انثذث يمىو تركثيش انصىسج انًهىَح. ذسرعًم انصىسج انشلًيح عهى َذى واسع فى ذطثيماخ انذاسثح ديث اٌ . لذسجعانيح عهى ذذهيم االشاسج انى عُاصش يخرهفح نًششذاخ يخرهفح وتًسرىياخ يرعذدج يًا يسًخ تاسرخالص ادق انًيزاخ انري ذذًهها االشاساخ . انًعايالخ انكثيشج هي االشاسج االصهيح وانصغيشج ذًثم انضىضاء ديث يرى ذذذيث انًذذدج انُاذجح يٍ ذذىيم انًىيم تاضافح يعايالخ جذيذج نها ) box and Bartlett )يثذا انركثيش ذى اعرًادا عهى طشيمري انًششذيٍ . ويٍ ثى يرى اسرشجاع انصىسج تطشيمح انرذىيم انًىيم انًعاكس ) box and Bartlett)ياخىرج يٍ انًذذدج االصهيح تطشيمري انًششذيٍ ذكىٌ اكثش ((Bartlettوانصىسج انًكثشج انُاذجح يٍ طشيك يششخ . انُرائج انرى وجذخ اٌ انصىسج انًسرشجعح تعذ انرذذيث راخ دجى يضاعف (.Bartlett)فى طشيك يششخ (Linear interpolation) تسثة اسرخذاو ال ((boxوضىح وَعىيح يٍ انصىسج انُاذجح يٍ طشيك يششخ matlab. (7.04)جىدج هزج انرمُياخ دسثد تاسرخذاو تشَايج داسىب يع نغح