Presentation on theme: "-BY DARSHAN ALAGUD UNDER THE GUIDANCE OF K.R.RAO. FALL 09, ELECTRICAL ENGINEERING DEPARTMENT, UNIVERSITY OF TEXAS AT ARLINGTON A Study on Fractal Image."— Presentation transcript:
-BY DARSHAN ALAGUD UNDER THE GUIDANCE OF K.R.RAO. FALL 09, ELECTRICAL ENGINEERING DEPARTMENT, UNIVERSITY OF TEXAS AT ARLINGTON A Study on Fractal Image Compression
Proposal Fractal-Based Compression using Partitioned Iterative Function Systems (PIFS) approach and fixed-size partitioning will be studied and compression and decompression of sample images using these methods will be demonstrated. Performance parameters such as MSE, PSNR, SSIM will be calculated for sample images and for different number of iterations. Also compression ratio, compression time and decompression time will be measured for these images. Using these parameters FIC is then compared with a standard frequency domain based compression standard, JPEG.
Introduction What is a fractal? A fractal is a geometrical shape that is self-similar. Example: The Sierpinski triangle:
Introduction Most physical processes in nature yield fractal structures. FIC exploit self-similarity in images of natural scenes like clouds, hills, trees, bushes and textures for compression. FIC technique represents images in terms of fractal codes or iterated function systems (IFS) that can be used to generate the original image.
Mathematical representation A grayscale image S maybe thought of as a subset of R3 (3D vectors of real numbers). Each point represented in R3 as (x, y, I(x, y)). An IFS is a set of contraction mappings: w 1,w 2 …,w n that when iteratively applied to any initial image S 0 results in a finite fixed set image S. The contractive mapping theorem guarantees the existence of such a fixed set for contractive mappings. Contractive mappings are transforms on points in metric spaces such that the distance between the transformed points is less than that between original points.
Mathematical representation The contractive mappings in an IFS used in FIC are affine transformations of the type : w i = contractive mapping applied on domain block D i. (x, y) are the pixel co-ordinates and z is the gray-level of pixel. i varies from 1 to number of domain blocks used in the partition. The a i1,a i2,a i3,a i4,d i1,d i2 specify the geometrical part of the transformation. In the algorithm used in the project, a i1 = a i2 = a i3 = a i4 = 0.5. d i1, d i2 are determined by the position of the top left corner of the domain block. c i represents contrast factor and b i the brightness offset.
Construction of an image using IFS of 2 affine functions. In the diagram above, the functions are represented by their effect on a square (each function transforms the outlined square into the shaded square). Both functions are applied to the input image and a union of the resulting images is formed in each iteration. First three iterations are shown, and then the final image (fixed point) after several iterations is shown. This image is taken from Creative Commons, author: Scott Draves .
Encoding The encoding involves choosing the IFS (coefficients of affine transforms) such that its fixed set approximates the input image S. In real images, textures vary from one part to other (Eg: skin, hair, clouds). Hence instead of mapping whole image to parts of images, larger parts are mapped to smaller parts. In this project, the algorithm used is known as PIFS, which finds contractive mappings from large parts of input image to smaller parts of the image.
Illustration of range and domain blocks matching in PIFS. () In the image below, the green outlined parts match due to ordinary similarity and the red outlined parts due to self- similarity.
Encoding Domain image is generated by taking the average of 4 neighboring pixels in range image (down-sampling and low-pass filtering). Partition range and domain images into blocks of size 16X16. (Fixed size partitioning approach). The most closest blocks are chosen( in the LMSE sense) and the corresponding coefficients of transforms that would transform block D i in domain image into block R j in range image is stored in the file. Number of range blocks = 4 * number of domain blocks used in this algorithm. Indices i and j are used to number the domain and range blocks with least value as 1.
Generation of domain and range images using Fixed-Size Partitioning The image above shows 4 neighboring pixels in range image (outlined in red) being averaged to give 1 pixel (blue) of domain image. Domain blocks before and after down-sampling are outlined in green and Range blocks are outlined in black.
Encoding: Finding c i and b i for each range and domain block pair The coefficients of the IFS will be of the form: a ij = 0.5. d ij = (depends upon the position of range block to which the domain block is mapped). The coefficients c i and b i (contrast and brightness settings) are calculated for each (R i, D j ) by minimizing the sum of squared errors given by: E(c i,b i ) = N k=1 (c i *d k + b i – r k ) 2 Which gives: c i = ( N N k=1 (r k d k ) - ( N k=1 r k ) ( N k=1 d k ) ) / ( N N k=1 d k 2 - ( N k=1 d k ) 2 ) b i = ( N k=1 r k - c i N k=1 d k ) / N Where d k, r k, are the pixel values in the domain and range blocks being compared. N = number of pixels in range/domain block (= 256 in this project). The above coefficients are quantized and stored in a compressed file.
Encoding: Range block splitting If the mean square error per pixel between the range and domain block exceeds a minimum mean square error per pixel specified by a parameter called q (quality), the range block is further split into 4 more blocks and the best affine map is again computed for each block. This process is repeated recursively until the quality q is met or the range block size reduces to 4X4 pixels.
Decoding Starting with any random image, apply the affine transforms with coefficients as encoded in the compressed file, repeatedly for several iterations (around 8-9 produces good quality). An image with maximum grey level value of 255 for all pixels is chosen in this project as the initial image. The size of the initial image is equal to that of the original image unless the image is to be scaled, in which case a larger image is chosen. The algorithm is guaranteed to converge to an image that is similar to the original image.
Sample input image 1 used in the project balloons.pgm  (at 50% magnification or size 320 X 240 pixels) :
Sample input image 2 used in the project columns.pgm  (at 50% magnification or size 320 X 240 pixels) :
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 10 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG0.652449.98560.988786- PIFS5.759940.52660.9653-1.9
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 20 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG1.909045.32280.972853- PIFS6.877739.75640.9530-4.5
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 30 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG3.967142.14610.949926- PIFS9.122738.52960.9354-6.8
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 40 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG7.409339.43300.919915- PIFS10.877137.76570.9213-8.8
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 60 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG27.423933.74950.82395- PIFS14.438836.53550.8977-12.8
Comparison of JPEG (left) and PIFS (right) images at compression ratio = 68 : 1 Compression standard MSEPSNR (in dB) SSIMQFq JPEG48.642331.26070.78833- PIFS15.765636.15370.8904-14.3
Illustration of Resolution Independent decoding (RID) (See  for original source). Uncompressed original image: Fractal decoded image (bottom left) and ordinary zoom(bottom right) (‘Nearest neighbor’ interpolation: replicating the nearest pixels of the original image) using Imagemagik at 2X. (Note: pX indicates p times the original image height and p times the original image width.)
Fractal decoded image (bottom left) and ordinary zoomed image (bottom right) using Imagemagik at 4X.
Fractal decoded image (bottom left) and ordinary zoomed image (bottom right) using Imagemagik at 8X :
Conclusions The PIFS algorithm can achieve high compression ratios that the frequency-domain-based programs such as JPEG cannot achieve without huge loss in image quality. This might be suitable for some applications where high-fidelity is not an important factor. Fractal encoding is highly computationally intensive, but decoding is very fast and hence maybe better suited for storage in image databases (websites) and storage media such as CD-ROMs. Resolution independence means higher magnified images are generated with more details visible as compared to ordinary zoom (‘nearest neighbor’ interpolation) which blurs out gradually. Hybrid methods of image compression that exploit redundancy due to similarity between parts of the image and also psycho-visual redundancy might be possible.
Applications OnOnesoftware, developed under license from Iterated Systems Inc., which is a photoshop plugin capable of saving files in compressed FIF (Fractal Image Format) . ClearVideo — also known as RealVideo (Fractal) — and SoftVideo were early fractal video compression products . Also used in a opensource codec called FIASCO (Fractal Image and sequencing coded). Fractal Image compression is especially useful when images are compressed only once but decoded several times (Ex: storage media like CD ROMs, or world-wide web applications). To date the most successful use of fractal image compression is by Microsoft in its Encarta multimedia encyclopedia which had images in FIF format .
References  Y.Fisher, Fractal Image Compression, SIGGRAPH’92, course notes.  K.R.Rao and P.C.Yip, The Transform and Data Compression Handbook, Boca Raton, FL, Academic Press, 2000.  M.Nelson and J.L.Gailly, The Data Compression Book, Second edition, New York, M&T books, 1996.  M.F.Barnsley and A.D.Sloan, A better way to compress images, Byte, pp.215-223, 1988.  N.Lu, Fractal Imaging, Chestnut Hill, MA, USA, Academic Press, 1997.  Texas Instruments, An introduction to fractal image compression, Literature Number: BPRA065, TI Europe, October 1997. From the following link: http://focus.ti.com.cn/cn/general/docs/lit/getliterature.tsp?literatureN umber=bpra065&fileType=pdf http://focus.ti.com.cn/cn/general/docs/lit/getliterature.tsp?literatureN umber=bpra065&fileType=pdf  Sample PGM images (balloons.pgm and columns.pgm) taken from from Iowa state university mathematics department site: http://orion.math.iastate.edu/burkardt/data/pgm/pgm.html http://orion.math.iastate.edu/burkardt/data/pgm/pgm.html
References  Image Sierpinski_Triangle.svg (released under public domain) taken from Wikipedia from the following link: http://en.wikipedia.org/wiki/Sierpinski_triangle http://en.wikipedia.org/wiki/Sierpinski_triangle  Baboon Images taken from McCormick Northwestern Electrical and Computer Science engineering website: http://www.cs.northwestern.edu/~agupta/_projects/image_processing/w eb/FractalImageCompression/index.html http://www.cs.northwestern.edu/~agupta/_projects/image_processing/w eb/FractalImageCompression/index.html  http://en.wikipedia.org/wiki/Fractal_compressionhttp://en.wikipedia.org/wiki/Fractal_compression  http://en.wikipedia.org/wiki/Iterated_function_systemhttp://en.wikipedia.org/wiki/Iterated_function_system  SSIM index.m downloaded from site:http://www.ece.uwaterloo.ca/~z70wang/research/ssim/ (Authors: Zhou Wang, Alan C. Bovik, Hamid R. Sheikh and Eero P. Simoncelli)http://www.ece.uwaterloo.ca/~z70wang/research/ssim/ Zhou WangAlan C. BovikHamid R. SheikhEero P. Simoncelli  Z. Wang, A. C. Bovik, H. R. Sheikh and E. P. Simoncelli, Image quality assessment: From error visibility to structural similarity, IEEE Trans. on Image Processing, vol. 13, no. 4, pp. 600-612, Apr. 2004.
References  http://www.interwoven.com (website of interwoven, formerly Iterated Systems Inc.)http://www.interwoven.com  M.Barnsley’s university webpage, Mathematical Sciences Institute (MSI): http://wwwmaths.anu.edu.au/~barnsley/http://wwwmaths.anu.edu.au/~barnsley/  Mean Square error definition: http://en.wikipedia.org/wiki/Mean_squared_error http://en.wikipedia.org/wiki/Mean_squared_error  PSNR definition: http://en.wikipedia.org/wiki/PSNRhttp://en.wikipedia.org/wiki/PSNR  JPEG software (version 8b) taken from the following site (Independent JPEG Group): www.ijg.orgwww.ijg.org  FIASCO : An open-source Fractal Image and Sequence Codec: http://www.linuxjournal.com/node/4367/print http://www.linuxjournal.com/node/4367/print  C. Christopoulos, A. Skodras and T. Ebrahimi, “The JPEG2000 still image coding system: and overview, IEEE Trans. On Consumer Electronics, vol.46, pp.1103-1127, Nov. 2000.  ] G. K. Wallace, “The JPEG still picture compression standard”, Communication of the ACM, vol. 34, pp. 31-44, April 1991.