Improving Accuracy in Fractal Dimension Calculation

0 downloads 0 Views 643KB Size Report
These properties of the fractal model have influenced its wide distribution during the ... This estimation bases sometimes on a fit through some few points, which often deviate from ... and the three plots could be thought of as of the sides of a triangle. ... which can be understood as elevations define triangular prisms, which.
Improving Accuracy in Fractal Dimension Calculation by Multiresolution Approach Reiner Creutzburg FH Brandenburg — University of Applied Sciences Department of Computer Science

P. 0. Box 2132 D-14737 Brandenburg an der Havel Germany creutzburg©fh-brandenburg.de Eugenyi Ivanov

Bremen Institute of Applied Beam Technology Kiagenfurter Str. 2 D-28359 Bremen Germany

ABSTRACT In this paper we describe the concept of the total and the fine fractal dimensions, respectively. Then, an efficient lowcomplexity algorithm for computing the fractal dimension is described. The method is then extended to the concept of fine fractal dimensions in order to separate textural and structural information of fractal curves and surfaces. A multiresolution approach for further improvement of the measurement results is introduced. The application results for topographic images are shown. Keywords : Fractals . fractal dimension , multiresolution,

1. INTRODUCTION Many objects in images of natural scenes are so complex and irregular that describing them by the familiar models of classical geometry is insufficient. The concept of the fractal dimension can be useful in the analysis and classification of shape and texture of images and image segments [12], [6]. This concept appears to us very important, because fractals are of close similarity to the natural surfaces and shapes ((mountains, clouds, ocean waves, leaves, trees, sounds, . . .) and can be even interpreted as the result of many basic physical processes. A. PENTLAND noticed that "the fractal model of imaged 3-D surfaces furnishes an accurate description of most textured and shaded image regions" [15}, [11], [12], [14], [16]. These properties of the fractal model have influenced its wide distribution during the recent years in topology [1], sedimentology [13] and particle morphology [9], [10], description of natural scenes [10], [15], image segmentation [17], [2], [3], [4], compression [21] and coding [19], computer graphics [7], [18] and even physiology [20]. It has become a powerful tool in image processing and it is clear that its importance will increase. The aim of this paper is to

.

develop a fast algorithm for calculating the fractal dimension of an image surface,

• analyze automatically global and local image structure charactered by their total and fine fractal dimensions and estimating the boundary between image texture and image structure, • describe the implementation of the algorithms on a PC, • improve recent algorithms for fractal dimension calculation by a multiresolution approach, • show some application results for fractal curves and fractal surfaces

170

o T. Asla, Editors, Proceedings of SPIE Vol. 3961 (2000) • 00

Fractal Dimension

Topologicol

Dimension —

I

1.00

1.02

1.25

I

I .45

Figure

1.

Illustration of the "roughness" of a curve using the concept of the fractal dimension

2. THE FRACTAL DIMENSION A fractal is defined as a set, for which its Hausdorif-Besicovich dimension strictly exceeds its topological dimension (for example 1, 2, or 3), see fig. 1. The main characteristic of a fractal is its fractional (fractal) dimension, where the fractal has its name from. The fractal dimension has not to be an integer - "fractus" — non integer. The fractal dimension can be computed by subtracting a fractional quantity from the classical (topological) dimension DT. This fractional quantity will be denoted by 3 (fig. 2). Then e have

D=I)T—3.

(1)

If an object can be described by its fractal dimension, the graph of the logarithm of the estimated perimeter or surface area against the logarithm of the resolution, at which the estimation has been computed, tends towards a straight line data relationship, known as the Richardson-Mandelbrot-plot. The calculated perimeter or surface area obviously increases when the resolution decreases. Therefore, the slope of the relationship is always negative. It tends towards zero for any regular Euclidean object and becomes non-zero, when irregular outlook is viewed. The slope of the relationship can be computed by a correlation function or by a linear regression and is the above mentioned fractional quantity /3. This estimation bases sometimes on a fit through some few points, which often deviate from a straight line. Obviously, the fractal dimension defined this way supplies only global information about the entire outlook of the analyzed images and is sufficient only for an ideal, fully self-similar fractal object. That's why we call it total fractal dimension and will denote it further by Dtf. Nevertheless, the total fractal dimension provides useful characteristics of the analyzed objects and is necessary for classification problems. We consider and use it as a basis for further computation and analysis.

3. THE FINE FRACTAL DIMENSIONS The recent results of the research works in the field of fractal model and fractal geometry point out that most of the natural objects are not ideal but semi-fractal. It means that there is a change in the original model of self-

171

I 0

1

2

3

4

6

5

7

In (resolution)

Figure 2. Determination of the fractal dimension similarity, as far as the deviation from the straight line Richardson-Mandelbrot-plot could be interpreted this way. The expression of this phenomenon is a break in the Richardson-Mandelbrot-plot and already Flook [6] reported on an empirical evidence, that often two linear regions appear in the plot as two separate fractional elements. Our experiments showed, that the Richardson-Mandelbrot-plot can even be considered as being composed of a large number of fractals, or "multifractals" , each of them representing the degree of shape irregularity and self-similarity at a limited scale of measurement. But it also appeared to us, that applying of more than two-element fractal models is not of great use either for the image analysis or classification, as far as the boundaries between the separate fractal elements can't be defined properly and absolute for all natural objects, and consequently it is not possible to estimate them automatically. The first element, observed at smaller dilatation of the resolution, characterizes obviously the finest edge or surface effects of the outline of the analyzed image. It is called by Kaye and Flook the textural fractal element and its quantitative measure is the textural fractal dimension, which we denote by D1 with

D1 = DT

/3i

(see fig. 3) . The textural fractal dimension provides therefore information about the irregular Euclidean object at a

very low level of resolution and consequently of abstraction.

The second element, beginning after the break point in the slope, was referred to by Flook as the structural fractal element, because it describes the object at a higher resolution level, it means, it describes its coarse nature, its structure. This element refers to the macro-scale outlook of the image. The fractional dimension, related to this element, is called the structural fractal dimension D2 with

D2 DT 132 fig. 3). Quantitatively evaluated, the absolute value of the sum of the fractional quantities and of D1 and D2 ,respectively,

(see

is always bigger than (or in the boundary case equal to) the absolute value of the fractional quantity of the total fractal dimension Dtf, whereby Dtf is either smaller or larger than the textural or the structural fractal dimensions, and the three plots could be thought of as of the sides of a triangle. Besides, D1 and D2 posses the same qualities as already pointed out by D (previous paragraph) , and can be defined and calculated in the same way, applying the same algorithm but for different resolutions. Although the estimation of these two new fractal dimensions brings our classification problem a step further, it is still not sufficient. Because of the above mentioned qualities it is necessary to determine which of these two dimensions is dominating. Saying it in a different way, to decide, whether the two- element fractal model (and so

172

14

13

— R-M-plot

12

-.-.- two-element R-M-plot

--- supporting line

1- ii 10

0

1

2

3

4

6

5

7

8

9

10

In (resolution)

Figure 3. Determination of the fine fractal dimensions the Richardson-Mandelbrot-plot) is convex, concave or even a straight line (fig. 4). Here we calculate the quotient L of the two fine fractal dimensions and use it for this purpose. This quotient is defined by L\

= I)1/D2.

According to the value of L one can distinguish among classes of fractal objects:

1. L

> 1: texture is dominant (texture of the analyzed image is more irregular than its structure,

2. L\ = 1, or zX fractal),

1: texture and structure are equally dominant (analyzed image is (more or less) fully self-similar

3. z < 1: structure is dominant (texture of the analyzed image is smoother and less irregular than its structure). If we find, that the analyzed image fits closely to the two element fractal model, it is also necessary to define the boundary of the two fine fractal models. Our experiments showed, that the break point abscissa coordinate Xb is well-suited for a boundary definition. The evaluation of the last definition sets some special requirements on the applied algorithm, i.e. on the computation of this value (see chapter 4).

4. ALGORITHM FOR COMPUTING FRACTIONAL DIMENSION OF GRAY-LEVEL IMAGES In this chapter we propose a new fast algorithm for calculation of fractal dimensions of gray-level image segments in a 3-dimensional space (i.e. topographic surfaces, gray-level images and others). The method uses a 3-dimensional equivalent of the "walking dividers" method in two dimensions. Consider a digitized image, where the appropriate values (of elevation or gray-tone) are ordered at the intersections on a regular square grid of uniform spacing in a Cartesian coordinate system. The highest resolution of the grid can be chosen by the user, according to the analyzed image. It can reach at the most pixel level. The problem is more severe by analyzing digital terrain maps as far as it determines the precision and the time consumption of the analysis. Given four pixels A, B, C, D, defining a square window, gliding over the grid without over-covering. We call them corners. Let us denote the corresponding values by a, b, c, d, and define a center of the square E and attach to it an interpolated value e, according to the formula e

= (a + b + c + d)/4.

So we can divide the square into four triangles connecting the corners with the center point - ABE, BCE, CDE, DAE. All triangles with their corner values, which can be understood as elevations define triangular prisms, which

173

12

12

11

11

10

10

5)

0

2

4

8

6

0

10

2

4

6

8

10

In (resolution)

In (resolution)

0

2

4

b)

a)

6

8

10

In (resolution C)

Figure 4. Different fractal models (original curves and corresponding Richardson-Mandelbrot-plots) a) convex (A < 1, structural components dominate); b) linear (A = 1 self-similar); c) concave (A > 1 textural components dominate). 8

Co

— R-M-plot

7

- . - quadratic R-M-plot

a)

a a C)

supporting line

6

(I)

C

5

o

1

2

3

Xb

4

5

6

7

In (resolution) Xb

- break point abscissa - break point ordinate

Figure 5. Break point determination in the Richardson-Mandelbrot-plot

174

[Algorithm of Clarke in [C1a861] ] new method

Operation addition subtraction multiplication division square root absolute value total

21 24

29

28 36

97

1



12

4

4



110

76

Table 1 . Number of operations for approximating the top surface area of a grid cell with different algorithms tops are part from the original gray-level image, whose surface area we want to calculate. The main idea of the algorithm is that we approximate the analyzed image by planar triangles, whose surface area is easy to compute, at different levels of resolution.

We calculate the surface area of the tops of the prisms by means of the vector algebra (vector multiplication). Each side of a triangle defines a vector, if we attach a direction to it. Therefore, it is only necessary to find out the vector coordinates, which is almost no problem, if we consider, that we want to compute a vector product and so we can change the origin of the coordinate system for every new triangle. We use the computation of the determinants of the coordinates to calculate the vector products. Given two vectors a and b, with Cartesian coordinates

a = (Xa,Ya,Za) and b =

(xb,yb,zb).

The vector product

Xa Za Xa Ya Xb Zb Xb Yb \\ and the surface area of the triangle spanned by these two vectors is

a x b = ( Ya

Za Zb

Yb

S=

1[Ya

2V Yb

2

Za Zb

,

Xa Za Xb Zb

2

Xa Ya Xb Yb

2

and (with already computed determinants)

S = (YaZb _ YbZa)2 + (x(lzb _ XbZa)2 + (XaYb

XbYa)2.

So we need only to calculate the vector coordinates, which is shown in fig. 5, whereby the origin of the coordinate system is wandering clockwise on the corners of the window, starting at point A and is kept constant for each triangle. The total surface area of the top of a grid cell is computed by adding of the top surface areas of the triangular prisms, defined in this cell: SABCD = SABC + SBCE + SCDE + SDAE, and the total top surface area of the gray level image is the aggregated surface area of all grid cells (square windows). This operation can be repeated for dilating cell sizes, and as already pointed out, the total top surface area will decrease.

We used cell sides equal to powers of two, starting by one (it means involving every pixel in the image) and ending by the largest power of two, smaller at least by one from the image size. This proved to be very useful, because a power or two (i.e. 256 x 256, 512 x 512 or even bigger) is a standard image size and defining the upper boundary this way, we prevent some undesired influences of the image surroundings. It also provides an uniform spread of the resolution in the logarithm scale, where the fractal dimension is computed. Because of the applied algorithm we use only 72 simple floating point operations (addition, subtraction and multiplication) and only 4 square root operations for calculating the top surface area of a grid cell. A detailed comparison of similar algorithms is listed in table 1. It has to be noted, that the square root and the absolute value floating point computations are standard subroutine calls and very time consuming.

175

A

B

D

S

C

D

Figure 6. Grid cell with side length s — triangular prism representation and top view

Description of the algorithm • Corner coordinates in the image array:

A = (x,y), B = (x + s,y),C=(x+s,y+s),

D=(x,y+s)

• Vector coordinates:

zABE:

origin = A A= (O,O,a)

= (s,O,b)

= (s/2, —s/2, e) = (—s/2, —s/2, a — e) = (s/2, s/2, b — e)

CDE:

origin = C C = (O,O,c)

= (—s,O,d)

=

(—s/2, s/2, e) = (s/2, —s/2, c — e)

T/ = (—s/2, —s/2, d — e)

zBCE: origin = B

===

(O,O,b)

(0,—sc) (—s/2, —s/2, e) = (s/2,s/2,b— e) = (s/2, —s/2, c — e)

zDAE:

origin = D

ñ = (O,0,d) A= (O,s,a) E = (s/2, s/2, e)

= (—s/2, —s/2, d

— e)

= (—s/2, s/2, a — e)

Triangles surface areas:

SABE =

s(b



a)2 + (2e — a — b)2

+2

SBCE

=

SCDE

=

s(d

SDAE

=

s(a_d)2+(2e_d_a)2+s2

— b)2 + (2e — b



c)2

+2





d)2

+2

c)2 + (2e — c

The total fractal dimension is calculated according to the above explained formula D1 = DT, where DT equals 2 since we analyze two-dimensional images. The fractional quantity 3 is the slope of the regression line, approximated through the calculated values in the double-logarithmic scale by a correlation function. The correlation coefficient, denoted by r, is interpreted as a measure for the deviation from the ideal fractal model.

176

8

-7 ci,

c ci C)

-5 Cl)

0

2

1

3

4

5

6

7

In (resolution)

Figure 7. Approximation to a quadratic polynomial After computing the total fractal dimension, the estimated values for each different spacing are approximated to a quadratic polynomial (fig. 7). The break point in the already estimated Richardson-Mandelbrot-plot is defined as the point of the parabola, described by the quadratic polynomial, at which the parabola and the straight line, obtained by the estimation of the total fractal dimension, possess the same slope 3. This means that first derivatives are equal) (see fig. 5). Therefore, the formulas for calculation of the break point coordinates are Xb

1/2 . ( _ ai)/a2

Yb

ao + alxb + a2x.

and

This definition was chosen because of the already introduced properties of D1 , D1 , and D2. Once found, the break point abscissa Xb is used to divide the fractal model into two parts -textural (on the left side of the break point) and structural (on the right side of the break point) fine fractal model (see chapter 3). Then, the textural and the structural fractal dimensions are estimated by correlation functions, whereby the correlation coefficients r1 and r2 can be interpreted as a measure for the deviation from the particular fractal model.

Finally, the quotient L = D1/D2 is computed. It has to be noted, that the decision, if the one- or the two element fractal model fits better the analyzed image, has to be made after computing all parameters Dtf , D1 , D2 , r, r1 and r2 . A break point exists only if 1. z differs noticeable from one,

2. r1 and r2 are far closer to one than r, 3.

the break point abscissa Xb can be attached neither to the first nor to the last resolution step (in such cases the estimated values at these resolution steps are treated as computational errors).

It has also to be pointed out, that the total fractal dimension Dtf is computed only if there are at least four observation points (four different resolution steps), and the fine fractal dimensions D1 and D2 -only if there are at least five observation points. These decisions are necessary only in the sense of more statistical safety. So the smallest images, which can be analyzed with the proposed algorithm have to be at least 9 x 9, if we want to apply the one element fractal model, and at least 33 x 33, if we want to apply the two-element fractal model.

Obviously, the statistical safety is higher, if we increase the image size. But it looks out as an optimization problem, as far as the size dilatation will increase the elapsed computational time, necessary for the analysis and 177

bring more complexity in the image and this way — problems by the application of the fractal model in general (mainly by classification problems, because of the necessity of uniqueness of the made decision) . This problem is investigated in detail in the next chapter 5. A computer program in C was implemented on a PC. The program is able to read digital image matrices and computes the total and fine fractal dimensions, the quotient of the fine fractal dimensions and the break point coordinates of an image surface or image segments. Because of the used algorithm, it is much faster than comparative ones.

5. INCREASING ACCURACY OF FRACTAL DIMENSION COMPUTED FROM THE RICHARDSON-MANDELBROT-PLOT Common methods for computing the fractal dimensions in d-dimensional signal analysis make use of different versions of the well-known walking dividers method [1}, [2], [3], [4]. Hence it takes the signal amplitude values at the sampling points, the intervals between them usually of the size

C = (2fl)d

(2)

Then, the sampling cell consists of (C + i)d signal points (C, n, d -integers). After the stepping off of the signal with the selected sampling interval size, its length or its surface area (if we consider the one- or the two- dimensional case) is computed and plotted in a double logarithmic scale diagram. This pair of logarithm values of the sampling interval size and the appropriate signal length or surface area we call measurement point. By repeating this calculation for different sampling interval sizes we get a set of measurement points (i.e. the Richardson-Mandelbrot-plot [12]). This representation is used to estimate the fractal dimensions by a least squares regression line. obviously the segments analyzed this way, have to consist preferably of (2' + 1)d signal points for keeping data losses as low as possible (If the number of signal points is different from (2 + 1)d, a segment with a size equal to the biggest value of (2' + i)d, fitting in the signal boundaries, is analyzed, and the resting boundary points are simply cut off.) and the number of different measurement points is equal to the number of divisors of the segment side length, i.e. n = log2 (2Th) . The in this way selected sampling interval sizes provide an uniform spread of the measurement points in the RichardsonMandelbrot-plot. Perhaps the most significant disadvantage of this method is that increasing the segment side length by a factor of 2 brings only 1 additional measurement point. An acute problem in computing the fractal dimension is the insufficient statistical safety, mainly in the case of very small signal parts, caused by the relatively small number of measurement points. It has to be noted that except the increasing of the number of measurement points, we have to analyze the whole signal, keeping data losses (on the image boundaries, as already noted) as low as possible, and the size of the analyzed segment has to be kept constant for each different sampling interval spacing in order to achieve the proper Richardson-Mandelbrot-plot for the particular segment (i.e. to analyze the image correct). In this chapter we give a solution to the problem of determining optimal segment sizes in order to increase the number of measurement points and thus to obtain more precise values of the fractal dimensions from the RichardsonMandelbrot-plot. Because of the above mentioned properties, the selected segment size must be sampled completely by each different sampling interval size. This condition is expressed mathematically in the following sentences. Consider the prime factorization of a natural number N:

N = p1p2 . . .p,

(p — prime,nj > 0).

(3)

By a well-known formula from the elementary number theory, the number of divisors q > 1 of N is qN = (ni + 1)(n2 + 1) . . . (n5 + 1).

(4)

is the number of different measurement points that can be easily obtained by formula (4). So for finding out N, we have to solve the following optimization problem, depending in a higher degree on the concrete application:

If N denotes the segment side length, then

qN=max,

S—N=min.

(5)

(Here we denote by S the window side length.) This new method for selecting the segment sizes has the following properties:

178

I segment side length Jumber

of mea- 1-dim. signal 2-dim. signal size (N + N surement points size (N + 1) 1)(N + 1) qN L_____________ 2=21 2 3 3x3 3 4

5 7

4

9

5x5 7x7 9x9

13

13 x

17

17x17

19

x 5'

6 5 6 6

21

19 x 19 21 x 21

x 31

8

25

25 x 25

x 7 x 3 x 5

6 8 6 9

29 31 33 37

29 x 29 31 x 31

8

41

8

43

43 x 43

10

49

49 x 49

4=22 6=2'x31

8=2

12 = 22

x 31

16=2 18 = 2' 20 = 22

24 = 2 28 =

22

30 = 21

x 32

32=2 36 = 22 x 32

40 = 2 x 5' 42 = 21

48 =

x 3 x 7

2x3

13

33x33 37 x 37 41 x 41

Table 2. Segment side length N (2 < N < 64), signal sizes and corresponding number qr of measurement points U)

C

0 0.

— segment side length 2

12

10

(maximal number of meas. points)

8

--- segment side length = 2"

C

E U)

E

0

0E

6

.o

4

2

C 0

2

4

8

16

32

64

Figure 8. Number of possible measurement points with different segment side lengths. . the total signal size is directly involved in the selection of the segment sizes, segment side length dilatation by a factor of 2 can bring more than 1 additional observation point, depending on the concrete application (table 1), S segments

with sizes N (2n)d can be analyzed,

I the segment sizes and the different sampling interval sizes could be calculated automatically, . the spread of the measurement points in the double logarithmic scale can be non-uniform.

Detailed description of the results is shown in table 2. From the shown results can be easily seen that segment side lengths equal to (2n)d are far not the best if we compare the number of measurement points (fig. 8). It has to be noted that each additional measurement point increases the elapsed computational time according to the following

formula:

Tc()

(6)

179

13

t

12

C)

Cl,

11

C

10

0

2

4

6

8

10

tn(resolution area)

Figure 9. Topographic image with total fractal dimension D1 = 2.19, D1 = showing a strong dominating structural component in the image

2.09,

D2 = 2.38 and L =

0.88