Box counting

Box counting is a method of gathering data for analyzing complex patterns by breaking a dataset, object, image, etc.

The essence of the process has been compared to zooming in or out using optical or computer based methods to examine how observations of detail change with scale.

This can be seen in Figure 1 where choosing boxes of the right relative sizes readily shows how the pattern repeats itself at smaller scales.

The relevant features gathered during box counting depend on the subject being investigated and the type of analysis being done.

Two well-studied subjects of box counting, for instance, are binary (meaning having only two colours, usually black and white)[2] and gray-scale[5] digital images (i.e., jpegs, tiffs, etc.).

For other types of analysis, the data sought may be the number of pixels that fall within the measuring box,[4] the range or average values of colours or intensities, the spatial arrangement amongst pixels within each box, or properties such as average speed (e.g., from particle flow).

A variety of scanning strategies has been used in box counting algorithms, where a few basic approaches have been modified in order to address issues such as sampling, analysis methods, etc.

[3][4] To illustrate, Figure 2a shows the typical pattern used in software that calculates box counting dimensions from patterns extracted into binary digital images of contours such as the fractal contour illustrated in Figure 1 or the classic example of the coastline of Britain often used to explain the method of finding a box counting dimension.

The fixed grid approach can be seen as a sliding box algorithm with the increments horizontally and vertically equal to

[2][8][11][12][13] Box counting may also be used to determine local variation as opposed to global measures describing an entire pattern.

Many such details reflect practical matters such as the size of a digital image but also technical issues related to the specific analysis that will be performed on the data.

Another issue that has received considerable attention is how to approximate the so-called "optimal covering" for determining box counting dimensions and assessing multifractal scaling.

[5][14][15][16] One known issue in this respect is deciding what constitutes the edge of the useful information in a digital image, as the limits employed in the box counting strategy can affect the data gathered.

The algorithm has to specify the type of increment to use between box sizes (e.g., linear vs exponential), which can have a profound effect on the results of a scan.

[17][18] To address various methodological considerations, some software is written so users can specify many such details, and some includes methods such as smoothing the data after the fact to be more amenable to the type of analysis being done.

Figure 1. A 32-segment quadric fractal viewed through "boxes" of different sizes. The pattern illustrates self similarity .
Figure 2. The sequence above shows basic steps in extracting a binary contour pattern from an original colour digital image of a neuron.
Figure 2a. Boxes laid over an image as a fixed grid.
Figure 2b. Boxes slid over an image in an overlapping pattern.
Figure 2c. Boxes laid over an image concentrically focused on each pixel of interest.
Figure 2b. Boxes slid over an image in an overlapping pattern.
Figure 2c. Boxes laid over an image concentrically focused on each pixel of interest.
Figure 3. Retinal vasculature revealed through box counting analysis; colour-coded local connected fractal dimension analysis done with FracLac freeware for biological image analysis.
Figure 4. It takes 12 green but 14 yellow boxes to completely cover the black pixels in these identical images. The difference is attributable to the position of the grid, illustrating the importance of grid placement in box counting.