Transcript Document

Fractal image compression. And Parallelization of the fractal-based compression algorithm.

Victor Butusov.

Saint Petersburg State University.

Scientific adviser: U.K.Demjanovich.

Contents

1. Introduction

1.1 The role of digital images in the modern world, and their adaptation 1.2 The concepts of the fractal, attractor, IFS.

1.3 Some general facts of the fractal image compression

2.

Theory that is concerned with the fractal-based compression algorithm

3. Fractal

image coding 3.1 Domain blocks 3.2 Range blocks splitting image with the quadtree method 3.3 Mapping of the domain blocks into the range blocks 3.4 Coding time

4.

Image decoding

5.

Distortion

q

uantitative assessment

6.

Resolution independence

7. P

aralleling

The role of digital images in the modern world, and their adaptation

Digital images occupy the increasing part of the information world. Development of the Internet, alongside with the availability of more and more powerful computers and progress in the "know-how" of digital chambers, scanners and printers, have resulted in wide use of digital images. That's why a constant interest to the improvement of the compression algorithms of the data images representing is growing.

Data compression is important both for the speed of transfer, and for the efficiency of the storage. Except for many kinds of commercial use, the technology of compression also represents an interest for the military, for example applications of data processing of the telemetry, received from the interceptors, or for the archival data storage about the image of a district for defensive actions modelling.

The decision of a compression problem of the image or, in more common sense, image coding, used achievements and stimulated development of many areas of technics and mathematics. We'll speak about rather new area of mathematics which has brought in the contribution to last researches about compression of images: fractals.

The concepts of the fractal, attractor, IFS.

It is much easier to describe fractals, than to define them. The key property describing fractals, is a self-similarity.

That is, when we look at a fractal, we see some set of elements which remains same irrespective of scale. The majority of objects is lost with details when them approach for more steadfast consideration. The fractal can approach indefinitely.

Two main properties: 1. The fractal can approach indefinitely 2. Fractional dimension Let d is a usual Euclidean dimension of space in which we have our fractal object (d=1 - a line, d=2 - a plane, d=3 - a usual three-dimensional space). Now, we'll cover this object entirely with d-dimensional "spheres" of radius

l

.

We shall assume, that for this purpose it was required not under the power(sedate) law,

l

( )

D l

than D - calls a Hausdorff or a Fractal dimension of this object.

For example the Fractal

D

 

l

lim  0 ln ln

l

dimension of a “Serpinsky napkin” is equal to:

D

 ln 3 ln 2 

l

1.5849

The IFS method (IFS - Iterated Function System)

Approximately in the middle of 80th years IFS method as a simple means of the fractal structures reception has appeared. The essence of this method by the example of the Serpinsky napkin consists in the following: Let's place an initial equilateral triangle with length of the side, for a distinctness equal to one, on a complex plane [z] how it is shown in figure at the left. By what linear transformation t1 on a complex plane it is translated into an equilateral triangle, shown on figure on the right, which size is 2 times smaller that the main one?

t

3 :

t

1 :

f z

1 ( )  2 1

z

Transformation t1. The cartesian coordinates of tops are given in brackets.

t

2 :

f z

2 ( )  2 1

z

 2 1 ( )  2 1

z

 4 1 

i

4 3 As a result of the transformations, 3 above named linear functions carry out required transformation of an initial triangle into 3 triangles which size is two times smaller than the size of the main one.

If we'll continue this process we shall receive a figure: For achievement of the same result we could start from any figure unessentially having the form of an equilateral triangle. For example, it could be the circle or a square or any other figure, that arbitrarily located on a plane. On each step decreasing in the sizes in 2 times and being tripled in quantity, these figures eventually would turn to the shapeless points indiscernible by an eye forming a fractal - Serpinsky napkin. The napkin is an original

attractor

for this IFS.

The fourth generation of iterations.

General facts of the fractal image compression

Fractal coding is a mathematical process which is applied to coding rasters which contains real images, in set of the mathematical data which describe fractal properties of the image. Fractal coding is based on that the majority of artificial and natural objects contains a surplus information as the identical repeating figures named fractals.

The image processable with the help of this way of coding, is resulted to a system of the mathematical equations named fractal codes. These mathematical equations are kept and used for the restoration of the image. Thus there is a compression of the data.

Fractal coding process demands a great volume of calculations.

The method of coding "Fractal Transform" is the most popular one. It was offered in 1986 by Michael Barnsli. It was the first algorithm for the mathematical description, that was applied for the real raster image.

1.

During transformation of the real raster data into the fractal codes 2 serious advantages are realized: An opportunity of scaling fractal images, while the unarchival process is in progress, without introduction of artefacts and loss of details. Unique feature of this algorithm is in following: the enlarged image is not devided into squares. The process of the fracatl panaromization does not depend on the resolution of the raster image. The scale is limited only of volume of computers free memory.

2. The size of the physical data that is used for the record of fractal codes is much less in sizes of the initial raster data. A degree of compression of the real image with the help of the fractal codings is up to 2000:2. And the bigger coefficients are achieved on real images what is not typical for algorithms with losses.

Estimation of a fractal algorithm compression.

• Has the best coefficient of compression (the champion among algorithms).

• Degree of compression: 2-2000 (it is set by the user).

• Symmetry: 100-100000.

• Prominent features: Can freely scale the image while decoding, increasing the size of the image in 2 4 times without applying of a " ladder effect ”.

" ladder effect ”

Class of the images that we consider.

• Full colored 24, 32 bit images.

• Or images

i

n greyscale without sharp transitions (Photos).

2. Theory that is concerned with the fractal-based compression algorithm

Metric space for images in greyscale color.

We can consider images in greyscale as a real functions f (x, y), that is

I I

.

2 

d

(, ) 

R

these functions as follows:

d

2   

I

2  |

I

2 

g x y

2

dxdy

 1/ 2

I

metrics. Then the space F - is a complete space . Images

f

 ).

n m

f

with which we shall work, are digital images. The digital image is a matrix of values ,

i

 taken in the fixed points

x y i j

).

In this case we shall speak about

(

rms)-root mean square:

d

rms

  

i n

  1

j m

 1

i

,

j

)

i

,

j

) |

2  1/ 2  

Systems of the iterated piecewise-defined functions.

• In fractal compression of images are used IFS of a special type, the system

of the iterated piecewise-defined functions

(partitioned iterated function system and a set of compressing representations

w i

:

D i

D

i

n

1,...,

n

Systems of the iterated piecewise-defined functions.

• • • • • • • •

Affine transformations of the image to the grey scale.

D A i i

)

I

2 

I

2

w x y I R

b

w i

A i

  

D i x

  

I

b i w i

R i w i

:

F

F w i

i i

 1 

o i

w

i

is convertible 

R i

s

i

o

i

w

i

expands or constricts a range of values of function

f

(operates contrast) increases or reduces values of gradation grey, or operates

a spatial component

w i

i i

 1 of transformation

w i

o i

brightness

a base affine transformation of grey scale images which we shall use in fractal coding

Spatial affine transformation And the opposite transformation to it .

Compressing representations of the images.

I

2

The Theorem about the compressing representations of the images

surface of

I

2

:

I

2  

Basic image Attractor

Fractal coding of the images

Range blocks can be the identical size, but adaptive splitting with the variable size of blocks (adaptive variable sizing) is used more often.

STEPS

The base fractal coding algorithm of images is carried out as follows:

R

i

adaptive circuit of splitting -

is a quad tree method

.

  blocks are rectangulars, but can be used other forms, for example triangles. used more often. It enables to fill densely parts in the images containing fine details with the range blocks of the small size. One widespread type of the 2. We cover the image with sequence of the domain blocks probably overlapped. Domains can have different sizes, and their amount is usual is estimated in hundreds and in thousand.

3. For every range block we find the domain and corresponding transformation which in the best way covers the range block. It is usual the affine transformation:

w

i

i i

 1 

o

i

We adjust parameters of transformation, such as contrast and brightness, for the best accordance.

4. If there is not enough exact accordance, we subdivide range blocks to smaller range blocks. We continue this process until or we shall not achieve comprehensible accordance, or the range blocks sizes will not reach some beforehand certain limit.

The diagram shows the basic steps of the images fractal coding

 |

i

 2

f x y dxdy

Domain blocks

We shall use a system with five parameters for the description of the domains system. As far as these five parameters are determined, the unique index unambiguously defines an arrangement of each domain block.

p

  

h

The domains row The domains column Domains level Horizontal overlap Vertical overlap Taken together, these parameters define, how many domains we have, how many the domain blocks. The size of the domain block decreases in a half with each

h

h

p

define, how many domains of the uppermost level are in one row and one column of overlapping blocks. These parameters accept values from 0.0 up to 1.0 where 1.0 means absence of the overlapping , 0.5 - a half overlapping, 0.0 - full overlapping. The

• • Rows () • Columns() • Level() total amount 8 8 8 8 8 8 8 8 8 8 8 8 1 2 2 3 3 3 • Horizontal overlap() 1.0 1.0 0.5 0.5 0.25 0.1

• Vertical overlap() 1.0 1.0 0.5 0.5 0.25 0.1

64 320 1186 5155 20,187 125,707

Range blocks( quad tree method)

• One method of splitting image on range blocks is a method of a quad tree. In the beginning rough splitting is made. We shall subdivide the whole image into four rectangulars.

• For every range the block the algorithm tries to find the domain and corresponding compressing representation which in the best way covers the range block. To provide compression, those range blocks which are bigger than the biggest domain, have to be broken into smaller range blocks.

• When we reduce a size of an admissible error, it results to the increase of the range blocks quantity, and the increase of the quad tree depth also results in increase of the range blocks quantity.

The effect of use of a smaller dismissible error and the greater quad tree depth. In each case a lot of range blocks means the worse compression (and sometimes and absence of a compression in general), but better quality of the image is usual.

Representation of the domain areas into the range.

• Search of conformity between domain and range areas is a three step process.

• • • 1. First, to the chosen domain 1 of 8 (4 turns on 90 degrees and mirror reflection in each orientation) base turns / reflections are applied.

2. Second, the rotated domain area is compressed to correspond to the size of the range area.

3. And, at last, the method of the least squares calculates optimum parameters of brightness and contrast

o

minimize expression  (

sd ij

• The decision is:

where

r ij

) 2

s

o

 

d

,  

r d

    

i j

(

d ij



i j

(

d ij

1

NM

1

NM

 

d

) 2 

i i j



j r ij d ij ij

r

) { }

ij o

Time of coding

• • • • • • • • • • • • • • • • One of the lacks of the images fractal coding is the large time of coding. It is known, that in cases when the number of domains is more than 100000, process of coding on a workstation occupies more than two days.

In table, there are 3 examples of coding images which were necessary for coding the image by the program on PC Pentium 200 MHz. The image used here is "Rose".

Quad tree debt 6 6 6 Admissible error 0.05 0.05 0.05

Rows Columns 8 8 8 8 8 8 Level 2 2 2 Horizontal overlap 1.0 0.5 0.5

Vertical overlap 1.0 Number of domains 0.5 0.5

320 1186 1186 Number of orientations 8 8 8 To find the best domain? NO Finite numbers of the range blocks NO Yes 1048 916 916 Average error (in pixels) PSNR Total coding time 3.844% 3.839% 24.17 Дб 24.32 Дб 15min 59 sec 2.982% 26.061 Дб 42min 32 sec 2h 19 min. 31 sec

Decoding images

• The image is decoded by iterative using transformations W to any initial image g, where 

i

R i

Quantitative estimation of distortions.

• We want to know, how much the decoded image differs from the initial one . But, as the perception of quality of the image is subjective, a question how to measure this difference, appears not simple.

N Rows

Number of rows

N Cols

Number of columns

M

Max value of grayscale

Graylevel f

Pixel value of the main image

d

Pixel value of the decoded image Let's consider 2 simple ways of measurement: the average pixel error and the peak attitude signal / noise (PSNR - peak signal-to-noise ratio).

Average pixel error :

1

N Rows N Cols rms

Miscalculation (least-squares method)

N

Rows

N

Cols i

   1

j

 1

|

f

d

|

PSNR

 20 log 10  

M Graylevel rms

 

rms

 1

N Rows N Cols N Rows

 1

N Cols

 1 |

f

d

| 2

Independence of the resolution

• • One of unique features of the fractal compression is that decoding does not depend on the resolution. During decoding we can receive the image of any size no matter of the image size which has been coded. This property allows to increase productivity of compression extremely. We shall assume, for example, that the image in grayscale, sizes of 256*256*256 is coded with help of 4000 range blocks. If to consider, that for storage of every range block it is required 4 bytes, then coding will demand approximately 16 Kb of memory. Comparing with 64 Kb for the initial image, we receive factor of compression approximately 1:4. Now we shall assume, that after coding the size of this image became equal 1024*1024. Then we receive factor of compression 256:1 course the image in grayscale of size 1024*1024*256 usually demands 1024 Kb of memory. Other feature promoting decoding of the image, coded with a fractal method, will be, that this decoding adds details to the image of the greater size. These details are artificial in the sense that they are not present in the initial image, however they do not contradict to a context.

the picture the example of “ Fractal increases ”, compared with an usual pixel increase is shown. Increase at 400 % concerning the initial size.

Details in “ Fractal increase ” look a little bit better.

Paralleling

• • 3.

Can we parallelize it or not and if it is possible, then how could it be?

Let’s consider the 3-rd step of the fractal compression algorithm.

For every range block we find the domain and corresponding transformation which in the best way covers the range block. It is usual the affine transformation:

w

i

i i

 1 

o

i

We adjust parameters of transformation, such as contrast and brightness, for the best accordance.

i

A i x

  

b i



i j

(

sd ij

 

ij

) 2

r

 1

NM



i j r ij d

 1

NM



i j d ij

Calculation of the sums sequence of numerical values

• • Where n is a quantity of summable values (

prefix sum problem

).

The traditional algorithm for the decision of this problem will consist of consecutive summation of elements of a numerical set • • The computing circuit of the given algorithm can be submitted as follows • Where

is a set of summation operations (tops designate operations of input, each top , corresponds to addition of value to the accrued sum ), and There is a set of the arches determining information dependences of operations Consecutive algorithm of summation

The cascade circuit of the summation algorithm

• • The variant of summation is based on use of associatively of the addition operation. The received variant of summation will consist in following: ᄋ On the first iteration of the cascade circuit all initial data are subdivided into pairs and for each pair the sum of values is calculated, ᄋ Further all received sums of pairs also are subdivided into pairs and summation of values of pairs is carried out again. e t. c.

The given computing circuit can be determined as a graph:

The cascade circuit of the summation algorithm

• • • • • • , The amount of iterations of the cascade circuit appears equal to size And total quantity of operations of summation coincides with quantity of operations of consecutive variant of the summation algorithm. At a parallel performance of separate iterations in the cascade circuit the total quantity of the parallel summation operations is equal to .

As result, it is possible to estimate parameters of acceleration and efficiency of the cascade circuit summation algorithm.

• • Where is the necessary quantity of processors for performance of the cascade circuit.

However thus efficiency of use of processors decreases at the increasing quantity of assumable values

Multiplication of a matrix to a vector

• • • • • .

The problem of multiplication of a matrix to a vector is defined by ratio Thus, reception of a resulting vector assumes recurrences of the same operations on multiplication of matrix rows and a vector . The achieving of each such operation includes element wise multiplication of the elements of a matrix row and a vector and the subsequent summation of the received products. The total quantity of necessary scalar operations is estimated by size .

As follows from the actions of a matrix multiplication to a vector, parallel ways of the problem decision can be received on the basis of the parallel summation algorithms.

Thank you