1 Introduction

Fractal dimension (FD) is a term used in fractal geometry to evaluate surface roughness of complex objects found in nature like cloud, mountain and coastlines. Generally utmost of the objects of the nature are convoluted and aberrant pattern, therefore it was very difficult to analysed and characterize these patterns by Euclidean geometry reported in [1, 2]. In order to describe these complex objects, fractal dimension comes into existence and it was initially presented by Mandelbrot [3]. Now a days fractal dimension becomes most popular in many kind of application such as pattern recognition, texture analysis, medical signal analysis and image segmentation reported in [4]. Many researchers contributed their effort in field of fractal geometry. Thus, different technique has been presented to estimate fractal dimension. Voss described and partitioned these techniques into three key concepts such as box counting, variance and spectral method reported in [5]. The box counting was most successful and widely used technique for estimating FD in various field of application due to its simplicity and easy implementation [6]. In this regard many box counting and its improved version comes into existence and found in many literatures [7,8,9,10,11,12,13,14]. Sarkar and Chaudhuri [8] proposed most appropriate technique, called the differential box-counting (DBC) in digital domain for FD estimation by taking maximum and minimum intensity point described in many literatures [15,16,17,18,19,20,21]. Jin et al. [10] presented relative DBC by adopting a convenient algorithm in terms of higher and poorer confines for better computation. Biswas et al. [22] presented the modified version of DBC by taking a parallel algorithm for efficient estimation. Chen et al. [1] presented another approach as similar to RDBC called shifting DBC (SDBC) by using the concept of shift operation. The improved Box counting (IBC) algorithm was presented by Li et al. [11] in terms of three modifications such as height selection, exact box number estimation and surface partitioning. Liu et al. [12] was presented another improved version of DBC approach called improved DBC (IDBC) by adopting three concept such as customize box-counting concept, choosing correct size of grid and shifting the box in spatial coordinates for better FD estimation. In order to enhance the accuracy over conventional box counting, Kaewaramsri et al. [13] was presented triangle box-counting (TBC) technique by partitioning the grid into two equal triangles for more accurate estimation of FD for binary images. Recently, an improved TBC (ITBC) was presented by same author [14] by dividing the each grid box into two triangles in terms of four patterns such as upper and lower right diagonal, upper and lower left diagonal for more precision box count. Recently Nayak et al. [23] presented modified triangle box counting technique that provides optimize performance in terms of less fitting error and simultaneously solve both under counting and over counting problem by implementing asymmetric triangle box partition.

The remainder of this article are represented as follows: in Sect. 2, the review of the background of fractal dimension and several DBC methods are discussed. In Sect. 3, the experimental results are outlined. At last our concluding remarks are outlined in Sect. 4.

2 Related background works

The FD is a major characteristic of fractal geometry to estimate surface roughness of whole image. The basic rules for estimation of fractal dimension of a whole image which is based upon the concept of self-similarity. When a large fractal object is divided into smaller parts each part is same as whole object. Consider a bounded set \(A\) in Euclidean n-space. The set is supposed to be self-similar if \(A\) is the union of \(N_{r} (A)\) different non overlapping copies, each different copies are scaled down by a ratio \(r\) and every scaled down copies are look like to the original copies itself. While in this regard, many techniques have been projected to improve the accuracy of FD estimation. The following subsections describe existing well liked methods which we have taken into consideration for our comparisons purpose and identify which technique is best suitable for estimation of FD of gray scale images. FD can be evaluated based on the concept of self-similarity. According to the box counting theorem [24], fractal dimension \(D\) of a set \(A\) can be evaluated as follows, FD can be estimated from the least square regression line of \(\log N_{r} (A)\) verses \(\log (1/r)\).

$$D = \log N_{r} (A)/\log (1/r)$$
(1)

2.1 Differential box counting

Sarkar and Chaudhuri [8] projected the differential box-counting (DBC) method for evaluation of FD of gray-scale images. In order to implement this algorithm, they represent gray-scale image in \(3D\) space, where \(2D\) space like \((x,y)\) represents an image plane and third coordinates like \(z\) represents the gray level. For this experimental analysis, they took a square image of size \(M \times M\) and partitioning into \(L \times L\) grids. Each and every grid comprise a stake of boxes of size is \(L \times L \times H\), where \(H\) indicates the height of a every box and this height can be calculated in terms of \(L \times G/M\), where \(G\) represents the total number of gray levels. Let the maximum and minimum gray values of (i, j)th grid fall in Lth and Kth box respectively, then the box-count \(n_{r} (i,j)\) can be evaluated as follows:

$$n_{r} (i,j) = L - K + 1$$
(2)

By taking involvement from all boxes, \(N_{r} (A)\) is counting for different value of \(L\) as follows:

$$N_{r} (A) = \sum\limits_{i,j} {n_{r} } (i,j)$$
(3)

2.2 Relative differential box counting

Based on original DBC, Jin et al. [10] presented an improved version of DBC called relative DBC (RDBC) by adopting same maximum and minimum intensity point on the grid and taking the scale limit such as upper and lower limits of scale ranges for accurately estimation of fractal dimension of texture images. These upper and lower scale ranges are determined from size of the image. Finally \(N_{r} (A)\) can be calculated as follows:

$$N_{r} (A) = \sum\limits_{i,j} {ceil[k{ \times }((K - L)/L^{\prime})]}$$
(4)

where \(k\) represents the coefficient in z-direction and \(ceil(.)\) is used to set the nearest integer.

2.3 Improved box counting

In similar to DBC and RDBC, Li et al. [11] presented another improved BC (IBC) mechanism by adopting three major parameters like height selection, exact box number estimation and surface partitioning. They are selecting box height by using the formula as below

$$r^{\prime} = \frac{L}{1 + 2a\sigma }$$
(5)

where \(a\) is a positive integer and set the appropriate value \(a\) as 3 (as the author [11] suggested \(a\) as 3 for accurate estimation of scaling factor) and \(\sigma\) represents standard deviation and \(2a\sigma\) represents image roughness. Finally \(n_{r} (i,j)\) can be evaluated as follows:

$$n_{r} (i,j) = \left\{ \begin{array}{ll} ceil\left( {\frac{K - L}{{r^{\prime}}}} \right) &if \ K \ne L \hfill \\ 1 & otherwise \hfill \\ \end{array} \right.$$
(6)

Final \(N_{r} (A)\) can be evaluated based on the Eq. (3).

2.4 Improved differential box counting

Liu et al. [12] proposed another improved version of DBC called improved DBC (IDBC) for estimating FD of gray scale image. In their proposed method, three modification have been done such as customize box-counting concept, choosing correct size of grid and shifting the box in spatial coordinates and \(n_{r} (i, \ j)\) calculated by taking maximum contribution from original and shifted grid all grid as follows in Eq. (7).

$$n_{r} (i,j) = \left\{ \begin{array}{ll} ceil\left( {\frac{{\mathop I\nolimits_{\hbox{max} } - \mathop I\nolimits_{\hbox{min} } + 1}}{s'}} \right) & \text{Im} ax \ne \text{Im} in \hfill \\ 1 & otherwise \hfill \\ \end{array} \right.$$
(7)

Inline to DBC and IBC \(N_{r} (A)\) can be computed based on the Eq. (3).

2.5 Improved triangle box counting

Kaewaramsri et al. [14] was presented an improved triangle box counting (ITBC) for accurate estimation of FD in digital domain by implementing equally triangle box partition. As a result, there are two patterns, p1 and p2, such that p1 is comprises of upper and lower right diagonals while p2 is comprises of upper and lower left diagonals. Then, both p1 and p2 are computed by averaging box-counts from both patterns, respectively. Finally \(n_{r} (i,j)\) of each grid box can be calculated by taking maximum contribution from both patterns as Eq. (8).

$$n_{r} (i,j) = Max(p_{1} ,p_{2} )$$
(8)

Finally \(N_{r}\) can be calculated by taking the contribution of all grids, then the FD can be estimated from all these methods by using least square regression line of \(\log (N_{r} )\) verses \(\log (1/r)\) using Eq. (1).

3 Result and discussion

In this section, experimental result and discussion are done to evaluate the performance of the five chosen methods and pointed out which method provides best suitable result in terms of less fit error and simultaneously solve all kinds of problems like over counting, under-counting; and also indicate which algorithm gives better recognition accuracy. The experiments are carried out on a system with a matlab14(a) in windows 8, 64 bit operating system, Intel (R) i7-4770 CPU @ 3.40 GHz. In this experimental analysis, we have considering five well liked methods such as DBC, RDBC, IBC, IDBC and ITBC and finally compared through five experiments, which have a set of original sixteen real Brodatz images [25] represented in Fig. 1, one set of twelve synthetic images represented in Fig. 4, and one set of eighteen generated synthetic texture like images represented in Fig. 6, one set of FKP database images [26] and one set of generated shrunken images. The details description of each experimental analysis is discuss in following subsections.

Fig. 1
figure 1

Sixteen Brodatz database texture images

3.1 Test on Brodatz images

In this section, we are using a set of 16 real texture images [25] of size 256 × 256 from Brodatz database for our experimental analysis which is represented in Fig. 1, However, fractal dimension can be calculated using linear fit straight line verses \(\log N_{r} (A)\) and \(\log (1/r)\). Then the error fit can be estimated from the root mean square distance of the data points from the line by using Eq. (9). Let \(y = mx + c\) be the fitted straight line, where \(x\) axis represents \(\log N_{r} (A)\) and \(y\) axis represents \(\log (1/r)\). Their corresponding FD and error fit are listed on Tables 1 and 2, The FD generated from DBC method are in the range from 2.309 to 2.697, similarly the other measure like RDBC, IBC, IDBC, and ITBC method are range from 2.291 to 2.712 and 2.308 to 2.729 and 2.353 to 2.745 and 2.272 to 2.659 respectively are listed in Table 1, and individual error fit of Brodatz images using five methods are listed in Table 2. The average error fit is estimated from each methods are 0.0626, 0.0611, 0.0622, 0.0531 and 0.0624 respectively are listed in Table 3 and presented on Fig. 2. The lower error fit indicates higher accuracy. We have seen from this experimental analysis, that only IDBC method yields less error fit for each individual images as compared to other four methods, that means it is crystal clear that IDBC method accurately estimates fractal dimension with less fit error because this method counted accurate number of boxes as compared to other existing method, hence resulted error fit is quit less as compared to other existing chosen methods and simultaneously provide less error fitting error in each individual images, whose data are presented in Fig. 3.

$$Error\;fit = \frac{1}{n}\sqrt {\sum\limits_{i = 1}^{n} {\frac{{(mx_{i} + c - y_{i} )}}{{1 + d^{2} }}} }$$
(9)
Table 1 Computational FD of 16 Brodatz database images
Table 2 Computational error fit of 16 Brodatz database images
Fig. 2
figure 2

Average fitting error of each corresponding method

3.2 Test on synthetic image 1

In this experimental setup, a set of 12 synthesize images are generated, which are presented in Fig. 4, In this process, each image are generated from original image by incrementing each intensity point (by formula \(2 \times (k - 2)\), where k lies from 1 to 12) in such a way that at the kth of 12th image, the maximum gray level should not exceed 255, therefore alternatively we can say that all the intensity surface are only shifted up to some gray levels from the original one in z direction. Theoretically, it was clear that, if we either increasing or decreasing by a constant value, then the FD should stay same as original one because theoretically both have the equal degree of roughness. Figure 5 represents computational FD and we have seen that expect DBC all other methods provide same estimated value because in DBC, gray level is fixed on the certain place in the z direction; the first box is in zero gray level and last box is in 255 gray level, this may cause over counting. From this result, we have crystal clear that except DBC method all other methods solve over-counting problems.

Fig. 3
figure 3

Computational error fit of Sixteen Brodatz database texture images

Fig. 4
figure 4

Twelve generated synthetic texture images

3.3 Test on synthetic image 2

In this experimental work, we have created 18 texture like images, which are represented in Fig. 6. From this experimental analysis, it is crystal clear that the except IDBC, all other chosen methods are not able to capture the roughness of these kinds of images having sharp gray level absorption at border of the box of block because the boxes with fix size at the fix location in spatial coordinate and some of the boxes will miss when sharp gray level absorption exist that leads to under counting problem. That means IDBC able to solve both kind of problem like over-counting and under-counting simultaneously. Figure 7 represents about the graphical presentation of computational FD of eighteen generated images. The details algorithm of generated synthetic images is listed below:

Fig. 5
figure 5

Computational FD of Twelve generated texture images

Fig. 6
figure 6

Eighteen generated synthetic texture like images

3.4 Test on FKP database images

In this section, we have used polyuFKP data base images [26] to evaluate the recognition accuracy of each selected method. Feature extraction provides a unique way to identify the object images and extracted its feature values. In this experimental setup, we have performed feature extraction technique on individual FD technique, which we have taken into consideration. This data base comprises of 990 numbers of images of four classes like left index (LI), right index (RI), left middle (LM) and right middle (RM). Sample images are presented in Fig. 8. Each individual class contains nine single figures with image resolution of 64 × 64 pixels. This analysis demonstrates the recognition rate of each chosen methods in terms of fractal feature. Feature extraction technique consists of two phases namely training and testing phase. The training feature was extracted by different methods with different reduction factor of size 2, 4, 8, 16, 32 as per the box-counting mechanism on left index, left middle, right index and right middle image set. We extracted 5 feature row of each sample, therefore 990 × 4 = 3960 total number of rows for each class in order to classify the box counting. Therefore 2, 4, 8, 16, 32 box size (scaling factor), and the total number of rows required 3960 × 5 for 5 classes. Then this extracted feature are applied to random forest algorithm [27] for classification because random forest is one the best accepted technique for classification in machine learning, which provides high accuracy of result in case recognition over all other approaches. It can use for classification over large database to achieve high accuracy [27] and it follows tree pattern values of the random class nodes and the level of distribution. The highest accuracy of FKP database image is 99.94 obtained from IBC method, while other methods like DBC, RDBC, IDBC and ITBC are obtained as 94.36, 94.41, 96.26 and 97.46 respectively. Hence, the more accurate FD feature lead to the higher accuracy of FKP recognition.

Fig. 7
figure 7

Computational FD of Eighteen texture like images

Table 3 Average error fit of individual dataset by using different methods

3.5 Test on shrunken images

In this experimental setup, we took forty images from Brodatz database of sizes 640 × 640 and reduce its size into four different sizes like 512 × 512, 256 × 256, 128 × 128, and 64 × 64 to observe the coefficient variances of fractal dimension. Since the reduced images are generated from the same image having similar texture then the coefficient variance should yields less. The less variance in one group indicates better accuracy as it is reduced from same image. The coefficient variance results of fractal dimension are listed in Table 4. The comparison diagram is presented as shown in Fig. 9. The IBC method coefficient variance in groups which are inferior to the other method are 24, which means 60% of the results are superior to the other methods and the average coefficient variance of improved proposed method are quit less than other five chosen methods. The average coefficient variance of DBC, RDBC, IBC, IDBC, and ITBC evaluated as 0.0383, 0.0359, 0.0315, 0.0402, and 0.0420 respectively. From this experimental analysis, we have conclude that IBC algorithm have better performance in identifying the same class of images with different scales compared with other five competent methods.

Table 4 The coefficient variances of FD of Forty shrunken images
Fig. 8
figure 8

a An acquired FKP image, b an ROI image with 110 × 220 pixels

Fig. 9
figure 9

The comparison diagram of coefficient variation of 40 shrunken images

4 Conclusion

In this paper, we have tried to made comparative study on different algorithm for estimation of fractal dimension of gray scale images in terms of five experimental analyses. Our findings reveal that the IDBC method, however yields a more accurate estimation in terms of less fitting error and solve both over counting and under counting problems simultaneously and also it was able to estimating accurate fractal dimension if sharp gray level abruption just at border of two neighbouring box blocks. Whereas the other methods like RDBC, IBC and ITBC methods only able to solve over counting problem, while DBC method won’t able to solve both problems. However ITBC method performs better for recognition accuracy for classification as compare to other chosen methods. This study demonstrates that a careful selection of fractal dimension algorithm is required for specific objects. Further systematic validation is needed on more kinds of surface generation algorithm to analysis fractal dimension on specific objects.