Fast Fractal Image Encoding vie One-Bit Transforms

4 downloads 0 Views 96KB Size Report
Fast Fractal Image Encoding vie One-Bit Transforms. Alexis M. ... Fractal image coding than traditional algorithms. ..... M.F. Barnsley, “Fractals Everywhere”,.
Fast Fractal Image Encoding vie One-Bit Transforms Alexis M. Tourapis*, Peter H. W. Wong**, Oscar C. Au***, Lam K.Ma Department of Electrical and Electronic Engineering The Hong Kong University of Science and Technology, Clear Water Bay, Kowloon, Hong Kong. Email: [email protected]*, [email protected]**, [email protected]***, [email protected] Tel.: +852 2358-7053***

ABSTRACT In this paper we present an algorithm for faster Fractal image coding than traditional algorithms. The algorithm involves a method of transforming the image from a multibit to a one-bit/pixel representation, applying MPEG like full search block based estimation on the new image and then refining the result with the use of statistical normalization and fast block -based motion estimation techniques for MPEG encoding. Simulation results suggest that the algorithm can significantly reduce the computation compared to traditional methods.

1. INTRODUCTION In recent years, there has been much interest in applying fractals to encode images and video sequences due to the potential of achieving very large compression ratios. Instead of coding the image itself, fractal coding achieves compression by encoding the self-similarity structure of the image [1,2]. One major drawback of fractal encoding is its large computational complexity due to the search for suitable affine contractive mappings. While much work has been done to reduce the computation complexity of fractal encoding, most of them try to reduce the number of comparisons but each comparison itself requires considerable computation. In this paper, we propose a novel algorithm to reduce the amount of computation by firstly transforming our image from a multibit to a one-bit/pixel representation, and then, by applying standard fractal search techniques to the new representation, derive different offset and scaling factor. It should be noted that due to the characteristics of the transformation, the distortion measure can be calculated not as a sum, but as a simple XOR calculation In the traditional fractal encoding [2], an image is divided into non-overlapping blocks called range blocks. For each range block, an exhaustive search is performed to find the optimal domain block which minimizes the mean square error (MSE), under certain affine contractive mapping. For each possible range block, the brute force domain-block search involves computing the optimal scaling factor and offset for each of the eight possible rotation and flipping issometrics. Let the image

size be PxQ, the range block size be NxN and the domain block size be 2Nx2N. Assuming P and Q to be much larger than N, the brute force search requires approximately ? P ?? Q ? ? ?? ?( P ? 2 N ? 1)( Q ? 2 N ? 1) ? N ?? N ? ?( 9 N ? 48 ) ? 9 P Q 2

2

(1)

2

multiplications and ?? P ?? Q ? ? 2 ?? N ?? N ? ? 2 ( P ? 2 N ? 1)( Q ? 2 N ? 1)? N ?? ?? ? ?

(2)

? P ?? Q ? ? 8? ?? ?( P ? 2 N ? 1)(Q ? 2 N ? 1) N 2 ? 8P Q 2 ? N ?? N ?

additions. For a QCIF sized image (P=176, Q=144) with N=8, this corresponds to 5.8x109 multiplications and 5.1x10 9 additions, which is excessive for encoding an image.

2. M OTIVATION In video coding, one-bit transformation has been used for Low-Complexity Block-Based Motion Estimation [5], with good results. Here we propose to use similar techniques on fractal coding by converting both the range and domain blocks into one-bit matrices. Then, instead of calculating the mean square error (MSE) distortion, which has a drawback of way many multiplications, we can simply perform the exclusive OR (XOR) operation between the two blocks. This way the complexity can be reduced tremendously. In addition, because we now only use the one-bit transformed images, we greatly reduce the memory requireme nts. The distance between two blocks u and v using the MSE is given by:

1 (3) ? ?u i, j ? vi , j ?2 N 2 i,j If both u and v are binary, taking the values of 0 and 1, this metric is now reduced to the following: MSE ?

MSE ?

1 N2

?

u i, j ? v i , j

(4)

i,j

where ? denotes the exclusive-or operation. Note that this expression computes not only the l2-norm but also l 1-, and ln-norm in general for any finite n.

For each range block r, compute the mean mr and 2 variance s r and transform each pixel xr,i in r by

8-bit Frame U

Filter with kernel K

Compare

1-bit Frame G

8-bit Frame Û Fig. 1. Operations for thesholding 8-bit frames to 1-bit frames.

3. PROPOS ED ONE-BIT ENCODING In this paper we propose two different one-bit transformation techniques. The first one is applying a special 17x17 filter on both the original and its down -sampled image, which will be used as the domain block reference. Let U be the original image and Û be the filtered version of U obtained by applying the convolution kernel K to U. Let G be the new image defined as:

??1, Gi , j ? ? ?? 0,

if U i, j ? Uˆ i, j otherwise.

? x r,i ? m r ?0 ? 0, if f ( x r, i ) ? ? ?r ?1, otherwise. ?

to yield a normalized range block rnor. We store all the normalized range blocks rnor and also initialize the “best domain block” to be the first domain block with infinitely large error MSEr. Again, it is necessary to apply the same method to each domain block d(decimated from 2Nx2N to NxN), and compute the normalized domain block d nor. Let us call this method the one-bit statistical normalization method. In the next step for both methods it is necessary to calculate the distortion between the range block r and the domain block d (decimated from 2Nx2N to NxN). As shown before, the calculation is now simplified from an addition to a simple XOR operation. We need to calculate the following two MSE values:

(5)

In this paper, we used a 17x17 convolution kernel K given below

if i, j? [1, 5,9, 13, 17] ? , K i, j ? ? (6) otherwise. ? 0, As explained in [5] the motivation for this method is that the edges in an image are key to accurate motion estimation. Using the above filter we can extract the edges and also retain, up to a certain degree, the information of our image. Let us call this method the K-kernel one-bit method. The operations for the one-bit transform are shown in Fig.1. We also need to apply the same filter on the 2Nx2N domain block after having it downsampled to a NxN block. 1 25

As an alternate technique we propose first applying statistical normalization to each NxN range block and then thresholding it to either one or zero. Statistical normalization was previously used as an alternate method for fractal image encoding [5], and the results were pretty impressive. Not only the computational cost decreased, but also the memory requirements were lower and the quality was better than traditional methods. By thresholding the normalized image, we can again say that we are extracting the edges of the image, and due to the character of the normalization, still retaining most of the information. The transformation is done as follows:

(7)

MSE1 ? MSE 2 ?

N

2

?

i ?1 N

x r, i ? x d , i

2

?

x r ,i ? x d ,i ?

i? 1

(8) N

?

2

x r, i ? x d , i

i ?1

(9)

? N ? MSE 1 2

and then if either MSE1 or MSE2 is less than MSEr of rnor, set MSEr to be the smallest of the above values and set the “best domain block” of rnor to be d. It is necessary to use both MSE1 and MSE2 because both d nor and –d nor are equally suitable for matching the normalized range blocks. For better results, after finding the best domain block for each range block using the above method, we can then use any of the already preexisting traditional fast motion estimation algorithms, (e.g. three-step search, 2D-log, Modified three-step search etc.) to try and find an even better estimation. In our case, we used a modified threestep search in which, on our second search, we were also examining not just the best block, but also the second best and thus increasing the accuracy since we were taking in consideration more points. The fast motion estimation did not have a significant effect to the overall computation.

4. COMPUTATIONAL REQUIREMENTS Both methods, approximately, require the same amount of operations. We can say that the necessary computations are of the same order with the statistical normalization method [4] mentioned here, but with the difference, that the computations

now refer to 1bit pixels and not 8 bit pixels. Accord ing to [5], the one-bit transformation can roughly have a 15:1 speed improvement (using 16bit-processor architecture). This figure actually is pretty much dependent on the processor architecture we use, and could be said that for 64bit processors we can even have a 64:1 speed improvement. We need to note that in our experiments we found that both methods yield slightly lower visual quality than the traditional method, and statistical normalization. Still if we take in consideration the computational gain of statistical normalization, plus the one-bit speed up factor, and the somehow small decrease in quality, it could be said that this methods could be used as an alternative to statistical normalization and/or traditional methods. We also need to note that the one -bit statistical normalization had slightly better results than the K kernel method. This seems to suggest that the transformation that was used in one-bit statistical normalization keeps much more information intact than the K kernel.

Table 1: Simulation Results

Image Lenna

Encoding method

Bit per pixel

PSNR (dB)

Traditional Stat. Norm. K kernel One-bit stat. norm

0.453 0.452 0.489 0.469

30.54 30.56 29.03 29.19

5. RESULTS AN D CONCLUSIONS The proposed encoding methods and the traditional method were applied to “Lenna” (512x512). The scaling factor and offset are both quantized to 7 bits. The bit rates (BR) and peak signal-to-noise ratio (PSNR) are shown in Table 1. As it can be seen there was a drop of 1dB in performance and also a small drop in bit rate. Still, it is very likely that by using a better fast motion estimation technique, or by selecting more points during the search, that the performance would improve. Even though there is some decrease in quality, we can still say that this method, due to the great improvement in computational cost, could be used as an alternative to the traditional methods and even the standard statistical normalization method.

6. REFERENCES 1. 2.

3.

4.

5.

M.F. Barnsley, “Fractals Everywhere”, Academic Press, New York, 1988. Y. Fisher, “Fractal Image Compression Theory and Application”, Springer-Verlag, New York, 1994 H. Peitgen, H Jürgens, D. Saupe, “Chaos and Fractals, New Frontiers of Science”, SpringerVerlag,1993. L.K Ma, O.C. Au, M.L.Liou, “A Novel Method in Reducing the complexity of fractal encoding”, EURASIP, Apr. 1996. V. Bhaskaran, B.Natarajan, K. Konstantinides, “Low-Complexity Block Based Motion Estimation via One-Bit Transforms”, IEEE Transactions on circuits and system for video technology, Vol. 7, No. 4, August 1997.

Fig. 2. Lenna using traditional method

Fig. 3. Lenna using 1st one step method

Fig. 4. Lenna using 2st one step method

Suggest Documents