An Approximated Box Height for Differential-Box-Counting Method to Estimate Fractal Dimensions of Gray-Scale Images

: The Fractal Dimension (FD) of an image deﬁnes the roughness using a real number which is highly associated with the human perception of surface roughness. It has been applied successfully for many computer vision applications such as texture analysis, segmentation and classiﬁcation. Several techniques can be found in literature to estimate FD. One such technique is Differential Box Counting (DBC). Its performance is inﬂuenced by many parameters. In particular, the box height is directly related to the gray-level variations over image grid, which badly affects the performance of DBC. In this work, a new method for estimating box height is proposed without changing the other parameters of DBC. The proposed box height has been determined empirically and depends only on the image size. All the experiments have been performed on simulated Fractal Brownian Motion (FBM) Database and Brodatz Database. It has been proved experimentally that the proposed box height allow to improve the performance of DBC, Shifting DBC, Improved DBC and Improved Triangle DBC, which are closer to actual FD values of the simulated FBM images.


Introduction
A natural scene could be treated as complex objects that could be represented using Fractal Geometry, which was introduced by Mandelbrot [1] in 1983.Fractal Geometry is used to define self-similar elements independent of scale, known as fractal set.FD is a measure to quantify the roughness or irregularities present in that set.Nowadays, researchers have been using FD in various computer vision applications such as texture, image segmentation [2], shape identification [3], palm print recognition [4], time series analysis [5], classification [6] and spatial variability analysis [7].Interested readers can find more application areas in [8].
Mandelbrot [1] first gave an idea to compute FD which was further advanced by Peleg et al. [9], Pentland [10], Keller et al. [11], Gagnepain et al. [12] etc.In [13], Sarkar et al. proposed a method known as DBC to compute FD using box counting (BC) technique, which became popular in research community because it is simple, easy to interpret and implement.However, it suffers from various drawbacks like over-counting of boxes along z-direction (quantization-computation), over-counting of boxes along xy-direction, lack of a proper box height, inappropriate use of grid sizes.Several modifications of DBC have been done to yield accurate FD values.Jin et al. [14] restricted the allowed range of grid sizes to avoid distortions occurred during line fitting to compute FD.Chen et al. [15] noticed that DBC suffers from over-counting of boxes along z-direction and proposed a new formula to compute the number of boxes required to cover rough surface over a grid (n r ), but authors used cubes to represent boxes.In [16,17], Li et al. used a new xy-plane partitioning mechanism to consider the gray-level variations between two adjacent grids that overlaps two adjacent grids by one row and one column.Authors also proposed a new formula to compute n r and two finer box heights.However, these box heights are too small, which increase the number of box counts significantly.As a result, more memory is required to store the large number of boxes.Liu et al. in [18] proposed a novel xy-plane shifting mechanism to solve the problem of under-counting.Authors used the grid sizes as only the divisors of the image size.In [19], Kaewaramsri et al. partitioned the square grid into two triangular grids to obtain better precision of box count.Interested readers can find various modifications of DBC in [20][21][22][23].
Out of different parameters of DBC, box height, which is directly related to computing the number of boxes required to represent the gray-level variations over a grid and badly affects the estimation of FD values.Larger box height incurs high error.While lower box heights require more computation.Some box heights depend only on the grid size on the contrary some depend on the image characteristics, whose values change according to the degree of roughness present in an image.It was observed that the box height is always directly proportional to grid size in order to preserve the scale of boxes.Different box heights used by different authors are defined in Section 2.4.Box height used by DBC method is directly proportional to number of gray-levels and inversely proportional to image size [13].Authors in [15] used cubes to represent a box.It means that the height is directly proportional to grid size.Some of the authors used maximum and minimum gray-level of an image as box height in their works [16,23] respectively.Authors in [17] used standard deviation (σ) of an image as box height.Box heights proposed in [16,17] are very small and accurate in estimating FD but are not dependent on image size.The impact of box heights have been studied thoroughly and proposed a new box height as a function of image size based using Brodatz Database [24], which is also validated using simulated FBM Database.Results show that the new box height allows to better estimate FD value with a less Distance Error (DE) than the box height used by DBC method.Rest of the paper is organized as follows: Section 2 discusses the traditional DBC method and its variants.Section 3 depicts experimental results, which help to propose a new box height as a function of image size.The validation of the proposed box height has been done on gray-scale images from simulated FBM Database and Brodatz Database in Section 3. The conclusion has been drawn in Section 4.

Databases
All the experiments have been performed on one publicly available Brodatz Database [24] and one generated FBM Database using random mid-point displacement algorithm [25].The Brodatz Database contains 112 textured images of size 640 × 640 pixels.This database is used to propose a novel box height for calculating FD values because this database is very much popular and used by most of the researchers in this context.Some of the textured images from Brodatz Database and generated FBM images with their actual FD values that could be generated using Hurst component (H) by 3-H are shown in Figures 1 and 2 respectively.The H varies from 0 to 1 with step size 0.1 and it is used to validate the proposed method in this work.

Fractal Dimension
Standard formula for computing FD of an ideal bounded fractal set, B, using BC method is expressed by Equation (1) [1].
where, N r is the number of distinct boxes of scale r that are required to cover the B. If the B is not an ideal fractal set then Equation (1) will give different FD values for different values of r.In that case the slope of the line obtained by fitting the points (logN r , log 1 r )∀r is known as the FD of the non-ideal fractal set.The detail description of the DBC method is given in Section 2.3.

The DBC Method
In 1992 Sarkar et al. [13] proposed an straightforward approach to estimate FD of a gray-scale image.Their methodology is as follows: a square image (I) of size M × M pixels is partitioned into non-overlapping grids of size s × s pixels where s is an integer and s varies from 2 to M 2 .The related scale (r) of a grid with size s × s pixels with respect to an image size M is denoted by an expression, r = s M .If s is not a divisor of M then non-image pixels of the grids on the boundary are treated as zero.
On each grid, there are a number of boxes of size s × s × h, to cover the rough gray-level image intensity surface over that grid and these boxes are assigned with a number as shown in Figure 3, where, .denotes the floor function and The G is the total number of gray-levels in a gray-scale image i.e., 256.The total number of boxes of size s × s × h, required to represent the rough surface over a (i, j)th grid of size s × s pixels, n r (i,j) is where, .denotes the ceiling function.The g max and g min are the maximum and minimum gray-levels present on (i, j)th grid respectively.The  The total number of boxes, N r , at scale r is required to cover the rough intensity surface of an image can be computed by Equation (4).
Then the FD of an image or the slope of a line is computed by fitting all the points ( 1 r , N r ) using Linear Least Squares as shown in The corresponding Distance Error (DE) incurred while computing FD can be estimated using Equation (5) defined as follows: where, m is slope of the line i.e., FD, b is the y-intercept and N is the total number of points used in fitting.
Box height is directly related to an image gray-level intensity variations which is characterized by z-axis in a 3D plane.It is clear that a larger value of box height is unable to compute accurate number of boxes.Whereas a lower value of box height is capable of finding out FD of an image accurately.However, it requires more memory to store box counts.Therefore, extensive study on the impact of different box heights have been done in this work to compute FD values.

Box Height
Box height is directly proportional to grid size s.It means that the ratio of box height and grid size is equal to a constant value.The box height should not exceed the size of a grid otherwise, it leads to an inaccurate FD.Moreover, box height should not be constant because in that case the scale of boxes (r) on different grids will not be maintained.Let us assume that 23 gray-levels are required to represent the rough surface over a particular grid.If the box height is 11 then 3 boxes are required to represent the rough surface.Out of these three boxes, first two boxes are completely filled up by 11 gray-levels and the third box contains only one gray-level.But, if the box height is 2 then 12 boxes are required with 11 full boxes and 1 box is added for one gray-level count.Again if the box height is 0.5 then a total of 46 full boxes are required to cover the rough image intensity surface.Therefore, h = 0.5 is more accurate and h = 11 is less accurate.Hence, a smaller box height is preferable and we have proposed a method to compute box height in Section 3.2.Different existing definitions for computing box heights are as follows: • A: In [13,14,[18][19][20][21][22], authors used a box height, h = s×G M , for their work.When M ≤ G then this box height becomes very large hence fails in providing accurate FD.
• B: Chen et al. considered h = s in their work [15] to compute FD.Sometimes it may happen that the box height is greater than the number of gray-levels in an image (h ≥ G); in that case only one box is required to represent the rough surface of a particular grid.Consequently, it leads to an inaccurate FD.
to be their box height in [16], where I max , I min are the maximum and minimum gray-level intensities present in an image respectively.The box height will be very small when an image is having a large texture variation.On the other hand, when gray-level differences (I max − I min ) will be small then the box height will be high as a result inaccurate FD value will be produced.
• D: Same authors proposed another formula for box height, h = s 1+2aσ , where σ is the standard deviation of an image and a = 3 is a constant in [17].But, the proposed box height is too small and it requires more memory space for storage.The value of this box height is almost same to the box height used in [16] and like C this box height is dependent on image gray-levels.

Impact of Box Heights
Firstly, three box heights namely, A: s×G M , B: h = s and D: s 1+2aσ (B>A>D) are selected for further experiment from A, B, C, D and E described in Section 2.4 because box height A is almost same to E for texture images and box height C is nearly equal to D. These box heights have been considered separately with DBC method by keeping other parameters same.The FD values along with DE values are then computed on Brodatz Database and they have been depicted in Figures 5 and 6.However, all the images are scaled down to standard 512 × 512 pixels before computation.Because for M = 256, A = B, hence these two box heights cannot be distinguished and simultaneously M = 640 is not selected since it is not a standard image size i.e., not a power of 2. The list of parameters of DBC method are reported in Table 1.It is clear from both Figures 5 and 6 that FD value increases when box height decreases.On the other hand, DE values increases while box height increases.

A Novel Method to Estimate Box Height
We can conclude from Section 2.4 that the standard expression for box height is as follows: where, R is any real number (R ∈ R) and R must be greater than or equal to one (R ≥ 1) because if the value of R is less than one and the value of s is large then h will be more than G in that case the obtained value of FD will be inaccurate.Most of the authors have considered R as a positive natural number for their works.Thus, a series of natural numbers 1 to 100 have been chosen for the value of R to compute FD value in order to find out a R value for an image, which satisfies Equation (7) 7 and 8 show different FD values and DE values for different values of R respectively, which has started from 1 to 100 with step size 1. Figure 7 contains the FD values of images, which are shown in Figure 2. The similar experiments have been performed on 112 images with different image sizes 128 × 128, 256 × 256, 640 × 640 and 1024 × 1024 pixels.It is observed that the same trend persist between these experiments as shown in Figure 7.Moreover, it is clear from Figure 7 that for all images when box height decreases i.e., R in Equation ( 6) increases then the computed FD value increases, but after some higher value of R the estimated FD value almost remains the same as R increases.Similarly Figure 8 shows that as box height decreases, incurred error i.e., DE, decreases.Though decreasing of DE values are not fully monotonic but eventually after some lower box height, i.e., for higher R values, the DE values remain almost the same.So, we have to find out a proper value of R for a particular image size in such a way that there is no significant change in the difference of two successive FD values for two successive values of R. DBC [13] SDBC [15] IDBC [18] ITDBC [22] s min 2 2 2 2

Grid shifting mechanism
No  Approximating R Let, FD p M R be a FD value of an image numbered as p from Brodatz Database having M × M pixels with a particular value of R where, R starts from one and M ∈ [128, 256, 512, 640, 1024].Now, smallest integer value, R, has to be found that satisfies Equation (7) for each image p at a particular image size It is observed from the experiments that the value of FD up-to four decimal places is enough to distinguish textures.Moreover, floating point arithmetic is very expensive.So, a threshold value 0.0001 is chosen for our work.Table 2 shows the number of images having the same R value for different image size that satisfy Equation (7).Here, R M max is marked using red color in Table 2, which represents the smallest R value for an M, after which FD value does not change significantly for all the images.3 that the obtained R value is not always greater than or equal to R M max .So, the next task is to find out an exact equation, which can replace Equation (8).In other words, an exact equation is expected in this work, which can find out R after putting M, where the value of R will be always greater than or equal to R M max without performing the above analysis.However, this analysis helps us to propose a novel box height, which depends on image size.The expression of R in Equation ( 8) is approximated by log 2 (M), which is shown in Equation ( 9).Initially we started with R = log 2 M × (log 2 (M) − 3) because it is the nearest multiple of log 2 (M) to satisfy for least image size M = 128 and its R 128 max = 28.This expression is again validated using different values of M (128, 256, 512, 640 and 1024).Unfortunately, it fails for image size 640 and 1024 as shown in Table 3. Equation ( 9) has two parts and 1 has been added to the second part, (log 2 (M) − 3).New formula is shown in Equation (10).
Again, Equation (10) has been validated for all image size M (128, 256, 512, 640 and 1024) and this time Equation (10) works fine for all image sizes M. The ceil function, . is used to deal with the image sizes, M which are not a power of 2 like when M = 640 i.e., to obtain an integer value.Hence, Equation ( 10) is used to fix the value of R. Therefore using Equations ( 6) and (10), the new box height proposed in this paper for DBC [13] is as follows: In Equation ( 11): Hence when log 2 (M) < 3, we need to restrict R. Hence if log 2 (M) < 3 then R = log 2 (M).Therefore the final proposed formula to compute box height is as follows: Eleven generated FBM images as shown in Figure 2 have been used for the first set of experiment to validate the proposed box height as denoted in Equation (12).The FBM images are generated using random mid-point displacement algorithm with different Hurst components.The value of Hurst component varies from 0 to 1 with step size 0.1 in this work.So, we have altogether 11 Hurst values, which help to create eleven FBM images.Moreover, Hurst component defines the actual FD value of an image.The different Hurst values and their acutal FD values are shown in 1st column and 2nd column of Table 4 respectively.The 3rd column of Table 4 depicts the FD values obtained using original DBC method.Table 1 shows different parameters of DBC, SDBC [15], IDBC [18] and ITDBC [22].Now, the proposed box height have been used and the achieved FD values for all the above mentioned images are shown in column number 4 of Table 4.The 5th and 6th columns of Table 4 show the difference of the FD values obtained by DBC method and new box height from actual FD values respectively.The DE values using both the methods are also reported in Table 4.It is clear from the columns 5th and 6th of Table 4 that the proposed box height allows to better estimate FD values, which are closer to actual FD values with less DE values.The same set of experiments using both the methods have been done on sixteen textured images from Brodatz Database as shown in Figure 1 and the results are shown in Table 5.We do not have actual FD values for these textured images.So, the actual FD values are missing in Table 5.However, the obtained FD values using the proposed box height of DBC are larger than the achieved FD values by the original DBC method.Thus, we can conclude that new box height of DBC estimates better FD values than the original DBC method.In the next set of experiment, original SDBC [15] and SDBC with proposed box height have been considered on eleven generated FBM images and sixteen textured images from Brodatz Database and the obtained results are shown in Tables 6 and 7 respectively.Then IDBC [18] method and the proposed box height have been used for the next set of experiments on eleven generated FBM images and sixteen textured images from Brodatz Database and the achieved results are shown in Tables 8 and 9 respectively.Again, similar experiments using ITDBC method [22] and proposed box height have been considered on both set of images i.e., on generated FBM, textured images and the gained results are reported in Tables 10 and 11 respectively.
To know the impact of the new box height for different methods such as DBC, SDBC, IDBC and ITDBC, we have also plotted the results of these methods obtained using their original parameters and the results obtained with the proposed box height as shown in Figure 9.While plotting, the actual FD values are represented in x-axis and the corresponding computed FD values in y-axis.It is clear from Figure 9 that for all the cases the proposed box height allows the four existing methods to compute better FD values compare to their original methods.Moreover, we can conclude from Figure 9 that the proposed box height together with ITDBC estimate better FD values for maximum set of experiments.
We have also plotted a similar graph for Brodatz Database in Figure 10.In x-axis of Figure 10 represents image number and y-axis denotes computed FD values using all the above mentioned methods.We can easily determine that the proposed box height along with ITDBC outperforms than other methods shown in Figure 10.
FD is the main factor that indicates image roughness.DE is merely a secondary component of FD values and if less DE is generated than it is good but slightly high DE is acceptable and that does not mean that the method is entirely bad.The main priority lies in better estimating FD values, Hence we relaxed DE value while defining proposed box height i.e., not all DE values generated by proposed box height for DBC, SDBC, IDBC and ITDBC are less when compared with their original box heights as shown in last columns of Tables 8-11.

Conclusions
In this work, the impact of box height in estimating FD values using DBC method has been studied thoroughly.It is clear from the literature that a larger box height is unable to compute FD value correctly.In other words, a lower box height produces better FD value with relatively less error.Thus, an equation for a new box height is proposed in this work based on 112 textured images of Brodatz Database.However, the new box height depends on image size and it generates relatively smaller box height compare to some of the existing methods in literature.The new box height is also validated on generated FBM images, which have been created using random mid-point displacement algorithm.
Several experiments have been performed on generated FBM images and images from Brodatz Database using DBC, SDBC, IDBC and ITDBC along with proposed box height.It was observed from the obtained results that the proposed box height allows to estimate better FD values with less errors in most of the cases with DBC, SDBC, IDBC and ITDBC methods.Moreover, it was observed that the proposed box height with ITDBC method outperforms other methods for all but only two FBM tested images.There are still some aspects of different parameters of DBC method that deserve further study.We have tested our proposed algorithm on gray-scale images only.So, we would like to work on color images.In future works,the behavior of the proposed method will be studied.We would also like to focus in the application areas of FD such as image segmentation, object recognition.

Figure 1 .Figure 2 .
Figure 1.Some of the sample textured images from Brodatz Database.
number, which contains g max .On the other hand, g min located in a box, which is denoted by box number

Figure 3 .
Figure 3. Sketch for determining the number of boxes, n r , by DBC method.

Figure 4 .
Figure 4.The log-log plot for the computation of FD.

Figure 5 .Figure 6 .
Figure 5. Different FD values for images from Brodatz Database using DBC method together with box heights A, B and D while image size is 512 × 512.

Figure 7 .Figure 8 .
Figure 7. Different FD values for images from Brodatz Database using DBC method along with box height, h(= s R ), while image size is 512 × 512.

Figure 9 .
Figure 9. Computed and actual FD values for generated FBM images using DBC, SDBC, IDBC, ITDBC along with the original and the proposed box height.

Figure 10 .
Figure 10.Computed FD values for images of Brodatz Database as shown in Figure 1 using DBC, SDBC, IDBC, ITDBC along with the original and the proposed box height.
The Equation (6) is applied as box height with other parameters of DBC described in Table1on 112 textured images from Brodatz Database at different image sizes 128 × 128, 256 × 256, 512 × 512, 640 × 640 and 1024 × 1024 pixels.Figures in this work.Bicubic interpolation method is applied on each of these images of size 640 × 640 pixels to resize them into 128 × 128, 256 × 256, 512 × 512 and 1024 × 1024 pixels for further experiments.FD of ideal fractal sets are invariant to size of the set i.e., for any value of s in Equation (1), the value of FD s will remain same.Since texture images are not ideal fractals, their FD value changes with the size of the image though the difference in FD values are less but not equal to zero.Hence we have used different image sizes in-order to relate their FD value and using their relation a new box height is proposed in this paper.

Table 2 .
(7)ding out the smallest values of R that satisfy Equation(7)for different image sizes of Brodatz Database.

Table 2 .
(8) expression of the plotted line is represented by Equation(8).
Now, this line is validated by putting different values of M (128, 256, 512, 640 and 1024) and the obtained R values are shown in Table 3.It is clear from Table

Table 3 .
Approximating R for all image sizes.

Table 4 .
Computed FD and DE values using DBC and the proposed box height for generated FBM images.

Table 5 .
Computed FD and DE values using DBC and the proposed box height for images from Brodatz Database as shown in Figure1.

Table 6 .
Computed FD and DE values using SDBC and the proposed box height for generated FBM images.

Table 7 .
Computed FD and DE values using SDBC and the proposed box height for images from Brodatz Database as shown in Figure1.

Table 8 .
Computed FD and DE values using IDBC and the proposed box height for generated FBM images.

Table 9 .
Computed FD and DE values using IDBC and the proposed box height for images from Brodatz Database as shown in Figure1.

Table 10 .
Computed FD and DE values using ITDBC and the proposed box height for generated FBM images.

Table 11 .
Computed FD and DE values using ITDBC and the proposed box height for images from Brodatz Database as shown in Figure1.