2011 Eighth International Conference on Information Technology: New Generations
Speeding-up Fractal Color Image Compression Using Moments Features Based on Symmetry Predictor Dr. Loay E. George Baghdad University/College of Science/Iraq
[email protected]
Dr. Eman A. Al-Hilo Kufa University/ Informatics Center for Research and Rehabilitation /Iraq
[email protected]
moment is used two times, the first as predictor of the isometric processes and the second is utilized to classify the image blocks in both domain and range pools. In this project the loaded RGB color image was transformed to YUV color space, where Y is the luminance component, and (U,V) are the chromatic components. In order to get an effective compression the (U,V) component are down sampled. Then the YUV reconstructed image were transform to RGB image using the inverse transform [7,8]. Also, in this paper Differential Pluses Coding Modules (DPCM) and shift code is using in reduction of encoding time. [9]
Abstract In this research, fractal compression technique using moment features based on the zero-mean range where improved by adding symmetry predictor to reduce the number of isometric trails from 8 to one trail. The first order centralized moments are used to index each domain and range blocks onto one of eight possible isometric states. At each range domain the indices of both domain and range blocks are passed through the predictor, then the predictor outputs the index of the required isometric transform (that needed to be applied on the domain block) to get the best possible match between the domain and range blocks. The moment features have been used to speed up the Iterated Function System (IFS) matching stage. These features are used to determine the block descriptor "moment's ratio index", which in turn is utilized to classify the image blocks in both domain and range pools. During the encoding stage the block moment ratio descriptor of each range blocks is used to filter the domain blocks and keep only those blocks whose moment descriptor is suitable to be IFS matched with the tested range block. The test results showed a lower encoding time (0.16) sec with appropriate PSNR. The time of speeding is about (99.9%) in comparison with that for traditional method. Keywords: Image Compression, Fractal Image Compression, Moments Features, Isometric Process.
2. Symmetry Predictor In order to increase the size of domain pool and, consequently, to increase the probability of finding the best (near optimal) approximations for the range blocks, each domain block is transformed by using a set of isometric transforms (i.e., rotation and flipping), such that eight versions (blocks) are produced for each domain block [6]. The eight isometric mappings are shown in Table (1). Table (1) The eight isometric transformations
1. Introduction Fractal image compression is expected to be a promising compression method for digital images in term of high compression ratios and fidelity. However, due to the unacceptable encoding time, use of this compression method is limited to areas where the encoding time is not critical. Therefore, acceleration of the encoding is indispensable to a variety of uses. In fractal based image encoding, an image is divided into sub-blocks and the root mean square metrics among them are computed. These metric computations for the sub-blocks must be done. Many attempts were done to speeding FIC using different methods [1,2,3]. One of these studies is applying moment features in FIC to speeding color image compression [4,5,6]. But in this research the 978-0-7695-4367-3/11 $26.00 © 2011 IEEE DOI 10.1109/ITNG.2011.94
ID
Sym
0
Nop
1
R90
2
R180
3
R270
4
M
5
M+ R90
6
M+ R180
7
M+ R270
Equations xc x yc y
xc
yc xc yc xc
( x c) cos90 ( y c) sin 90 c
y
( x c) sin 90 ( y c) cos90 c
( x c) cos180 ( y c) sin 180 c
( x c) sin 180 ( y c) cos180 c
( x c) cos270 ( y c) sin 270 c
yc ( x c) sin 270 ( y c) cos270 c x c 2c x yc y
xc yc xc yc
( x c) cos90 ( y c) sin 90 c
2c x 2c x 2c y 2c y c
y
( x c) sin 90 ( y c) cos90 c
x
( x c) sin 180 ( y c) cos180 c
2c y
( x c) cos180 ( y c) sin 180 c
x
xc ( x c) cos270 ( y c) sin 270 c 2c y
yc ( x c) sin 270 ( y c) cos270 c x Where c=(m-1)/2 R90 Rotation_90; R180 Rotation_180; R270 Rotation_270; M Mirror or Reflection;
508
1. Is M 10 t M 01 or not?
A full search through the set of 8 isometric states of each block is prohibitive due to the large number of calculation involved. The goal is to exclude isometric states of blocks that have no chance of being selected as the best choice. The involved calculation for block indexing and transform prediction should be simpler than the full calculation. This would ease the burden of searching by reducing the set of possible candidates to minimal error. So, in this research work a novel for speeding up fractal image compression is presented and demonstrated which depend on the first order moments descriptor. The theoretical basis of this predictor of the isometric processes is:
2. Is M 10 t 0 or not? 3. Is M 01 t 0 or not? The use of these three Boolean criteria leads to eight block classes, as shown in Table (3). Table (3) The truth table for the eight blocks classes Block's Class Index 0 1 2 3 4 5 6 7
A. Centralized Moments: In general, moments are set of parameters which describe the distribution of material (in image processing it is equivalent to brightness) from a reference point or an axis. The idea of using moments to construct the image feature vectors is one of the most common utilized methods used today. Each moment order reflects different information for the same image. For an image block I(x,y) {x,y| 0,1,…..,m-1}, its first order centralized moments are defined as:
¦¦ I ( x, y) I ( x c) ,…...….................. (1)
Old class Index (Nop)
m1 m 1
¦¦ I ( x, y) I ( y c) ,………...….....….(2)
0 (TTT) 1 (TTF) 2 (TFT) 3 (TFF) 4 (FTT) 5 (FTF) 6 (FFT) 7 (FFF)
y 0x 0
Where I is the mean value of I block. Combining equations (1) and (2) with the equations listed in Table (1), the relationship between the new moments values c , M 01 c ) of a transformed block with its old ( M 10 moments' values ( M 10 , M 01 ), before transformation, could determined. Table (2) shows these relationships. Table (2) The relationship between moments before and after the isometric transformation ID
Sym
0
Nop
c M 10
c M 10 M 01
M 01
1
Rot.90
c M10
c M 01 M 01
M10
2
Rot180
c M10
c M10 M 01
M 01
3
Rot.270
c M10
c M 01 M 01
M10
4
Ref.
c M10
c M10 M 01
M 01
5
M.+Rot.90
c M10
c M 01 M 01
M10
6
Ref.+Rot180
c M10
c M10 M 01
M 01
7
Ref +Rot.270
c M10
c M 01 M 01
M 01 t 0
T T T T F F F F
T T F F T T F F
T F T F T F T F
Table (4) The class indexes before and after symmetry transforms
y 0x 0
M 01
M10 t 0
Now, consider the relationship between the new and old moment values when the block is mapped by one of the considered symmetry transforms, see Table (3). Then, the relationship between the block classes indexes could be established, see Table (4).
m 1 m 1
M 10
Boolean Criteria M 10 t M 01
Relationship
New Class Index R90
R180
R270
M
M+ R90
M+ R180
M+ R270
5 (FTF) 4 (FTT) 7 (FFF) 6 (FFT) 1 (TTF) 0 (TTT) 3 (TFF) 2 (TFT)
3 (TFF) 2 (TFT) 1 (TTF) 0 (TTT) 7 (FFF) 6 (FFT) 5 (FTF) 4 (FTT)
6 (FFT) 7 (FFF) 4 (FTT) 5 (FTF) 2 (TFT) 3 (TFF) 0 (TTT) 1 (TTF)
2 (TFT) 3 (TFF) 0 (TTT) 1 (TTF) 6 (FFT) 7 (FFF) 4 (FTT) 5 (FTF)
4 (FTT) 5 (FTF) 6 (FFT) 7 (FFF) 0 (TTT) 1 (TTF) 2 (TFT) 3 (TFF)
1 (TTF) 0 (TTT) 3 (TFF) 2 (TFT) 5 (FTF) 4 (FTT) 7 (FFF) 6 (FFT)
7 (FFF) 6 (FFT) 5 (FTF) 4 (FTT) 3 (TFF) 2 (TFT) 1 (TTF) 0 (TTT)
The arrangement of the contents of Table (4) could be inverted, such that the type of transform needed to map the block index from certain state to other state is listed, as shown in Table (5). Table (5) The required symmetry operation to convert the block's moment status New Block State Index 0 1 2 3 4 5 6 7 0 0 6 4 2 5 1 3 7 1 6 0 2 4 1 5 7 3 2 4 2 0 6 3 7 5 1 Old 3 2 4 6 0 7 3 1 5 Block State 4 5 1 3 7 0 6 4 2 Index 5 1 5 7 3 6 0 2 4 6 3 7 5 1 4 2 0 6 7 7 3 1 5 2 4 6 0 Un dashed areas represent ID of Sym as in Table(1)
M10
B. Blocks Classification: In this section, a new method for block classification based on moment criteria is described. The classification is based on status of its first order moments values (i.e., M10, M01). Three status criteria have been used, where:
509
3. Moment Ratio Descriptor For a range block with pixel values (ro,r1,…,rn-1), and the domain block (do,d1,….,dn-1) the contractive affine approximation for zero-mean is [2,4 ]: ric s d i d r ,……...….……….....…… ….. (3)
Where,
1 m
r
m 1
¦r
,………….……..................…
i
i 0
(4) 1 m
d
m 1
¦d
,……….…….........….…....... (5)
i
i 0
m 1
¦ d r dr i i
i 0
s
,…………….….………….(6)
mV d2
Where, mV d2
m 1
¦ d
i
d
2 ,…..……….…………..(7)
i 0
For image block f(x,y); the moment of order (p+q) of a zero-mean block (f), around its center point (xc,yc), is defined as: M p, q
4. Encoding Process To implement this selective search scheme the following block indexing algorithm had been implemented: 1. Load BMP image and put it in (R,G,B) array (three 2D arrays). 2. Convert (R,G,B) array to (Y,U,V) array 3. Down sample the components U and V. 4. For each color component (i.e., the original Y, and the down sampled U,V) do: A. Construct the domain and range pools. B. For each domain block listed in domain pool: a. Determine its moments, Md(1,0) and Md(0,1) using equations (9 and 10), then determine its moments ratio (Rd) using equation (15). b. Determine the moments ratio index value (Id) using the following equation: I d round Rd xN max ,...………........(18)
¦¦x x y y > f x, y f x, y @,……......(8) q
p
c
y
c
x
So, for the domain and range blocks the first order moments are: M d 1,0
M d 0,1
k 1
¦ ¦ x k d i
j 0
i 0
k 1
k 1
i
ij
c
ij
¦ ¦ x k r i
d ,….………..…....(10)
c
ij
r ,……..……….....(11)
i 0
k 1 k 1
¦ ¦ y k r i
j 0
d ,…………..….......(9)
i 0
k 1 k 1 j 0
M r 0,1
c
¦ ¦ y k d j 0
M r 1,0
k 1
c
ij
M r2 0,1 M r2 1,0
,…..………...….…..…(16) M r2 0,1 M r2 1,0 It is easy to prove that the magnitude of (R) factor is rotation and reflection invariant. By combining equation (3) with equations (11, 12), and substitute the results in equation (16) it leads to: Rd R r ,…………………………...…….....…..(17) This results implies that "if the two blocks (range and domain) nearly satisfy the contractive affine transform (i.e., equation 3), then their moment ratio factors ( Rd and R r ) should have similar values. This doesn’t mean that any two blocks have similar R factor should necessarily satisfy the affine transform". This fact is utilized to improve (speeding up) the range-domain search task. So, instead of IFS-matching all domain blocks with each range block, only the domain blocks whose (R) magnitudes are similar to that of the tested range block are IFS-matched. Rr
r ,…………...........(12)
i 0
Where, Md is the domain moment, Mr is the range moment; (xi,yi) are the x and y coordinates of (i,j) pixel, k is the block length and kc is the value of x and y coordinates of the center point, it is: k 1 ,…………..….…………....…........….(13) kc 2 Now, let us consider the following moments ratio factor (R): M 2 0,1 M 2 1,0 ,………………......…....(14) R M 2 0,1 M 2 1,0
Where, Nmax is number of Rd-bins, it represents the maximum moment’s ratio index value, taking into consideration that the magnitude of (Rd) doesn’t exceed (1). c. Register the block coordinates (posI) of the domain block, and its calculated moments ratio index value (Id) in a temporary array (L) of records. C. Sort the records of the array (L) in ascending order according to their moments index values (Id). D. Establish a set of pointers P to address the start and end of each block of records that have same index (Id) value. E. For each range block listed in the range pool :
So, the moment ratio factors for domain and range blocks are: M d2 0,1 M d2 1,0 ,………...……...…....(15) Rd M d2 0,1 M d2 1,0
510
a. Determine its moment ratio (Rr) using equation (16), and the corresponding moment index value (Ir) using the following equation:
Ir
To evaluate the established color FIC system some sets of tests have been conducted to study the effect of each involved coding parameter on the performance of the developed compression system. To test the effect of each parameter its value was varied while the values of other parameters were kept fixed.
round Rr xN max ,........................... (19)
b. Use the set (p) of pointers and the temporary list {L} of records; to match only the domain blocks whose Id values equal to Ir. In each matching instance determine the scale (s) and error ( F 2 ), using the following equation for the 8 possible isometry cases:
F2
m 1
>
5.1 Threshold Tests (Emin) This parameter is used to stop the matching of the domain which has the same moment ratio index. So if F 2min >Emin then the search is stopped, and the current matching instance is chosen as the best matched domain. Table (6) shows the effect of Emin on the compression performance parameters.
@2
¦ (ri r ) s (d i d ) …………….(20)
i 0
Each determined value of (s), should be bounded to be within the predefined extent [smax, smax]. 2 c. Compare the result F min of each matching
Table (6) The effect of Emin on compression performance parameters Wr=2,,,,,,Em=2 Nmax Emin PSNR CR Te
2 instance with the minimum F min (updated in
previous matching instances). If F 2 is smaller 100
2 2 than F min then set F min = F 2 , and register the associated values of ( sq , Sym, PosI ) of the
matched domain block as the best IFS matching parameters.
200
F 2min
d. In case that the new registered minimum is less than the predefined threshold (Emin) then the search process is stopped, and the set ( sq , Sym, PosI ) is output as a best encountered
300
IFS match for the tested range block, then go to step (4e). e. Otherwise, start testing the next domain blocks whose (Id) values are (Ir±1) to get the best IFS match, the minimum threshold value in such case is taken little bit higher than Emin (i.e, it is taken Em). If an acceptable match instance was not met, then the next set of domain blocks whose (Id) values are (Ir±2) should tested. And so forth, till reaching the domain blocks whose moments ratio index is (Ir±Wr), in such case the registered IFS code associated with minimum 2 error ( F min ) is considered as the best attained match. The search window [Ir-Wr, Ir+ Wr] represents the extent of IFS matching trials. f. Output the set of IFS codes ( is , ir , Sym, PosI ) for the tested range block, and return to step (4e).
400
2 4 6 8 10 2 4 6 8 10 2 4 6 8 10 2 4 6 8 10
31.68 31.27 31.23 31.19 31.13 31.11 30.79 30.75 30.71 30.66 30.73 30.46 30.40 30.34 30.28 30.39 30.18 30.11 30.05 30.00
10.38 10.38 10.38 10.39 10.39 10.38 10.38 10.38 10.38 10.38 10.39 10.37 10.36 10.36 10.37 10.36 10.37 10.37 10.37 10.37
0.38 0.32 0.30 0.28 0.29 0.26 0.24 0.23 0.22 0.21 0.22 0.22 0.19 0.18 0.18 0.19 0.18 0.17 0.17 0.16
The results show that PSNR and encoding time (Te) are inversely proportional with Emin and Nmax but the compression ratio (CR) is approximately constant during this variation. The variation in compression performance parameters (PSNR, Te) with Emin is larger and faster than their variations with respect to Nmax. The results show that Em is more effective in decreasing encoding time than Emin
5.2 Threshold Test (Em) This parameter is used to stop the transition 2 between Rd-slots, such that if F min >Em then the search is moved to the neighbor Rd-slots in order to get the best range-domain match. Table (7) shows the effect of Em on the compression performance parameters.
5. Tests Results The proposed system was establish by using Visual Basic 6.0 and tested on a core 2duo, 2 GHz processor. In all these tests Lena image (256x256, 24 bits/pixel) has been used as test material.
511
Table (7) The effects of Em on the compression parameters Nmax
10
20
80
100
Em
2 4 6 8 10 2 4 6 8 10 2 4 6 8 10 2 4 6 8 10
Wr=2,,,,,,Emin=2 PSNR CR Te 10.34 1.35 32.75 31.87 10.32 0.82 31.08 10.32 0.57 30.62 10.35 0.42 30.04 10.38 0.32 32.55 10.37 0.89 31.73 10.41 0.57 31.05 10.43 0.42 30.50 10.45 0.32 30.06 10.47 0.27 31.83 10.37 0.40 31.19 10.39 0.27 30.63 10.40 0.22 30.18 10.41 0.19 29.82 10.41 0.16 31.68 10.38 0.36 31.13 10.39 0.25 30.67 10.40 0.20 30.22 10.41 0.18 29.88 10.41 0.17
10 20 30 40 50 60 70 80 90 100 200 300 400 500 600
Reconstructed image
(24 Bits/pixel)
PSNR=30 CR=10.41 Te=0.16
PSNR=31.35 CR=10.56 Te=0.13
5.3 Window Size (Wr) Test This parameter is used to bound the number of Rbins whose domain blocks should tested to find the best matched domain block. If Wr is set equal to 1 then the search will cover only the bins {Ir-1,Ir, Ir+1}, while if Wr is set 2 then the search will cover the R-bins lying within the range [Fr-2,Fr+2] and so forth. Table (9) shows the effect of Wr and Nmax on the compression performance parameters. Table (9) Effects of Wr and Nmax on the compression performance parameters Wr
2
4
Table (8) Minimum Te for Nmax required to have the same PSNR (30) dB Wr=2,,,,Emin=2 Em CR Te 10.2 10.38 0.31 10.4 10.47 0.24 9.6 10.39 0.23 10.3 10.40 0.20 10.0 10.41 0.19 9.2 10.45 0.19 9.4 10.42 0.18 9.0 10.41 0.18 9.0 10.40 0.17 9.4 10.41 0.16 7.5 10.44 0.17 5.5 10.40 0.16 4.2 10.38 0.16 3.2 10.37 0.16 2.0 10.37 0.17
Reconstructed image
Fig (1) Samples of two reconstructed images with minimum time
The results indicate that PSNR and Te are inversely proportional with Em and Nmax but CR is increasing very slowly with variations of these parameters. The variation in compression performance parameters (PSNR, Te) with Em is larger and faster than their variations with respect to Nmax. Table (8) shows minimal encoding time that required getting appropriate PSNR for various Nmax value [10-600].
Nmax
Original Image
PSNR
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
6
8
10
Figure (1) shows a sample of Lena and Child reconstructed image with lowest Te time 0.16 sec and 0.13 sec respectively (when Nmax=100, Em=9.4, and Emin=2, Wr=2). This indicates that there is speeding about (99.9%) than traditional method.
Nmax
100 200 400 600 100 200 400 600 800 1000 100 200 400 600 800 1000 100 200 400 600 800 1000 100 200 400 600 800 1000
Em=2,,,Emin=2,,, PSNR CR Te 31.78 10.38 0.37 31.11 10.38 0.26 30.39 10.36 0.20 30.00 10.37 0.18 32.22 10.38 0.48 31.60 10.38 0.33 31.02 10.37 0.26 30.61 10.36 0.20 30.26 10.36 0.20 30.05 10.36 0.18 32.28 10.38 0.61 31.90 10.38 0.41 31.36 10.38 0.30 30.99 10.37 0.25 30.70 10.36 0.22 30.41 10.36 0.20 32.40 10.37 0.70 32.10 10.38 0.50 31.56 10.38 0.33 30.24 10.37 0.28 30.98 10.36 0.24 30.75 10.36 0.23 10.37 0.83 32.48 31.20 10.38 0.54 31.72 10.38 0.37 31.40 10.38 0.31 31.17 10.37 0.27 30.96 10.37 0.25
The results show that PSNR and Te are directly proportional with Wr and inversely with Nmax but CR is nearly not affected by the variation of these parameters. The variation in compression parameter caused by Wr is very small and slow in comparison with their variation caused by the variation of the number of Nmax parameter. 512
6. Conclusions The color FIC based on moments indexing method by using symmetry predictor gives a quality forward step in reduction encoding time of the PIFS without making significant degradation in image quality. There is a decrease in Te about 800 times in comparison with the time of traditional method, and about (96.7%) or (30 times) in comparison with the same method without using symmetry predictor. This reduction in times gives the solution of encoding time of fractal image compression. The proposed algorithm could be combined with quadtree, or HV partition scheme to increase the compression performance.
References 1.
2.
3.
4.
5.
6.
7. 8. 9.
Tong, C.,”Fast Fractal Image Encoding Based on Adaptive Search”, IEEE Transaction on Image Processing, Vol.10.No.9, 2001. Al-Hilo, E., George, L., "Color FIC by Zero-Mean Method", 4th International Conference of Information Technology and Multimedia (ICIMU’ 2008), pp. 631-636 Hartenstein, H., Ruhl, M., and Saup, D., "RegionBased Fractal Image Compression", IEEE Transaction on Image Processing, vol.9, No.7, July 2000. Al-Hilo, E., George, L., "Speeding- up Fractal Color Image Compression Using Moments Features", Digital Image Computing: Techniques and Applications, DICTA 2008, pp. 486-490, IEEE, ISBN: 978-0-7695-3456-5 George, L., Al-Hilo, E., " Speeding-Up Color FIC using Isometric Process based on Moment Predictor", International Conference on Future Computer and Communication, ICFCC2009, April 3 - 5, IEEE, ISBN: 978-1-4244-3754 (PP 607-611) Frigaard, C., "Fast Fractal 2D/3D Image Compression ", Report, Institute of Electronic Systems, Alborg University, Laboratory of Image Analysis, 1995. Ning, L., “Fractal Imaging”, Academic Press, 1997. Sangwine, S. J., Horne, R., “The Color Image processing Handbook”, Champan & Hall, 1998 Gonzalez, R., and Woods, R.,” Digital Image Processing”, Pearson Education International, Prentice Hall, Inc., 2nd Edition, 2002.
513