35
Fractal image compression. And Parallelization of the fractal- based compression algorithm. Victor Butusov Victor Butusov. Saint Saint Petersburg Petersburg State University State University. S cientific adviser: cientific adviser: U.K.Demjanovich.

Fractal image compression. And Parallelization of the fracta l-based compression algorithm

Embed Size (px)

DESCRIPTION

Fractal image compression. And Parallelization of the fracta l-based compression algorithm. Victor Butusov . Saint Petersburg State University . S cientific adviser: U . K.Demjanovich. Contents. 1. Introduction 1.1 The role of digital images in the modern world, and their adaptation - PowerPoint PPT Presentation

Citation preview

Page 1: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Fractal image compression. And Parallelization of the fractal-

based compression algorithm.

Victor ButusovVictor Butusov..

SaintSaint PetersburgPetersburg State University State University..

SScientific adviser: cientific adviser: UU.K.Demjanovich.

Page 2: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Contents1. 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 quantitative assessment

6. Resolution independence

7. Paralleling

Page 3: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Page 4: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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 dimensionLet 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 . We shall assume, that for this purpose it was required not less, than spheres. Then, if at enough small the size varies with under the power(sedate) law,

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

( )N ll

l1( )

DN l

l

( )N l l

0

ln ( )lim

lnl

N lD

l

For example the Fractal dimension of a “Serpinsky napkin” is equal to:ln 3

1.5849ln 2

D

Page 5: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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?

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

1: ( )

2t f z z

2 2

1 1: ( )

2 2t f z z

3 3

1 1 3: ( )

2 4 4t f z z i

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.

Page 6: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

The fourth generation of iterations.

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.

Page 7: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

During transformation of the real raster data into the fractal codes 2 serious advantages are realized:

1. 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.

Page 8: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Estimation of a fractalEstimation of a fractal algorithm compression.algorithm compression.

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

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

• Symmetry: 100-100000.Symmetry: 100-100000.

• Prominent features: Can freely scale the image while decoding, increasing the 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 ”.size of the image in 2-4 times without applying of a " ladder effect ”.

" ladder effect ”" ladder effect ”

Page 9: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Class of the images that we consider.Class of the images that we consider.

• Full colored 24, 32 bit images.Full colored 24, 32 bit images.

• Or imagesOr images in greyscale withoutn greyscale without

sharp transitions (Photos).sharp transitions (Photos).

Page 10: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

• Metric space for images in greyscale color.

2I

We can consider images in greyscale as a real functions f (x, y), that is determined on a single square That is

Where N - is the number of a grey gradation. We can enter the metrics on these functions as follows:

Let's define a space F of the real functions, integrated with a square on with the entered metrics. Then the space F - is a complete space. Images with which we shall work, are digital images. The digital image is a matrix of values

where Thus, it is a matrix of the fixed values of function taken in the fixed points

In this case we shall speak about (rms)-root mean square:

2 .I I I 2: {1,2,..., }f I N R 2 (, )d

2

1/ 2

22 ( , ) | ( , ) ( , ) |

I

d f g f x y g x y dxdy

n m, , 1,..., , 1,..., ,i jf i n j m

2I

, ( , ).i j i jf f x y ( , ),f x y( , ).i jx y

1/ 22

1 1

( , ) | ( , ) ( , ) |n m

rms i j i ji j

d f g f x y g x y

Page 11: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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 - PIFS). PIFS consists of full metric space X, a set of sub areas and a set of compressing representations

, 1,...,iD X i n : , ,...,i iw D X i n

Systems of the iterated piecewise-defined functions.

Page 12: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Affine transformations of the image to the grey scale.

• Let is the affine transformation that translates a single square into itself: , in other words

• for some matrix of the size and a vector of the size . Let - some sub area of an individual square and let - area of values of the transformation

working on set , so • Now we can determine the representation operating on the image , as

• is convertible

• expands or constricts a range of values of function (operates contrast)

• increases or reduces values of gradation grey, or operates brightness• a spatial component of transformation

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

( , )iw x y2 2I I

( , )i i i

xw x y A b

y

iA ib 2

iD I2I iR iw

iD ( )i i iw D R:iw F F ( , )f x y

1( )( , ) ( ( , ))i i i iw f x y s f w x y o

iw( , ) ix y R

is f

io

iw iw1( )( , ) ( ( , ))i i i iw f x y s f w x y o

Page 13: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Spatial affine transformation And the opposite transformation to it .

Page 14: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Compressing representations of the images.

Page 15: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

The Theorem about the compressing representations of the images

We shall subdivide into the quantity of that makes a surface of :

2I

2I iR2I

Page 16: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Basic image Attractor

Page 17: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Page 18: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

1. We share the image f on nonoverlapped range blocks . In our example range blocks are rectangulars, but can be used other forms, for example triangles. Blocks can be equal, but adaptive splitting with the variable size of blocks is 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 adaptive circuit of splitting - is a quad tree method.

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:

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.

iR

iR

1( )( , ) ( ( , ))i i i iw f x y s f w x y o

Page 19: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

The diagram shows the basic steps of the images fractal coding

2

( )

| ( , ) ( , ) |i

i

R

w f x y f x y dxdy

Page 20: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

ph

The domains rowThe domains columnDomains levelHorizontal overlapVertical overlap

Taken together, these parameters define, how many domains we have, how many various sizes of the domains and what large overlap it is allowable. Parameters and define, how many domains of the uppermost level are in one row and one column of the domain blocks. The size of the domain block decreases in a half with each increase of a level of domains parameter . , operate a degree of the 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 less values of , we have, the more domains we shall take.

h

h

Page 21: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

• Rows () 8 8 8 8 8 8• Columns() 8 8 8 8 8 8• Level() 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• total amount 64 320 1186 5155 20,187

125,707

Page 22: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Page 23: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

• 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.

Page 24: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

Page 25: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

where

• To find optimum contrast and brightness , we need to find values and which would

minimize expression Here and are the values of pixels of

domain and range areas. These pixels are in rectangular arrays with M rows and N columns.• The decision is:

s os o2( )ij ij

i j

sd o r { }ijd{ }ijr

/s

,o r d

( )( )ij ij

i j

d d r r 2( )ij

i j

d d 1

iji j

r rNM

1

iji j

d dNM

Page 26: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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 8 8 8• Columns 8 8 8• Level 2 2 2• Horizontal overlap 1.0 0.5 0.5• Vertical overlap 1.0 0.5 0.5• Number of domains 320 1186 1186• Number of orientations 8 8 8• To find the best domain? NO NO Yes• Finite numbers of the range blocks 1048 916 916• Average error (in pixels) 3.844% 3.839% 2.982%• PSNR 24.17 Дб 24.32 Дб 26.061 Дб• Total coding time 15min 59 sec 42min 32 sec 2h 19 min. 31 sec

Page 27: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Decoding images

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

( )( , ) ( )( , )iW g x y w g x y ( , ) ix y R

Page 28: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Let's consider 2 simple ways of measurement:the average pixel errorand the peak attitude signal / noise (PSNR - peak signal-to-noise ratio). Average pixel error :

, ,1 1

1| |

Rows ColsN N

i j i ji jRows Cols

f dN N

1020log GraylevelMPSNR

rms

2, ,

1 1

1| |

Rows ColsN N

i j i ji jRows Cols

rms f dN N

RowsN

ColsN

GraylevelM

,i jf

,i jd

rms

Number of rows

Number of columns

Max value of grayscale

Pixel value of the main image

Pixel value of the decoded image

Miscalculation (least-squares method)

Page 29: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Page 30: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Paralleling

• 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.

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:

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

1( )( , ) ( ( , ))i i i iw f x y s f w x y o

( , )i i i

xw x y A b

y

2( )ij ij

i j

sd o r 1

iji j

r rNM

1

iji j

d dNM

Page 31: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

Consecutive algorithm of summation

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

Page 32: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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

Page 33: Fractal image compression. And  Parallelization of the fracta l-based compression 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

Page 34: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

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.

Page 35: Fractal image compression. And  Parallelization of the fracta l-based compression algorithm

Thank you