Theoretically, the intent of box counting is to quantify
fractal scaling, but from a practical perspective this would require that the scaling be known ahead of time. 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. In fractal analysis, however, the scaling factor is not always known ahead of time, so box counting algorithms attempt to find an optimized way of cutting a pattern up that will reveal the scaling factor. The fundamental method for doing this starts with a set of measuring elements—
boxes—consisting of an arbitrary number, called \Epsilon here for convenience, of sizes or calibres, which we will call the set of \epsilons. Then these \epsilon-sized boxes are applied to the pattern and counted. To do this, for each \epsilon in \Epsilon, a measuring element that is typically a 2-dimensional square or 3-dimensional box with side length corresponding to \epsilon is used to scan a pattern or data set (e.g., an image or object) according to a predetermined
scanning plan to cover the relevant part of the data set, recording, i.e.,
counting, for each step in the scan
relevant features captured within the measuring element.
digital images (i.e., jpegs, tiffs, etc.). Box counting is generally done on patterns
extracted from such still images in which case the raw information recorded is typically based on features of pixels such as a predetermined colour value or range of colours or intensities. When box counting is done to determine a
fractal dimension known as the
box counting dimension, the information recorded is usually either yes or no as to whether or not the box contained any pixels of the predetermined colour or range (i.e., the number of boxes containing relevant pixels at each \epsilon is counted). For other types of analysis, the data sought may be the number of pixels that fall within the measuring box, When used to find a
box counting dimension, the method is modified to find an
optimal covering.
Sliding box scans Another approach that has been used is a sliding box algorithm, in which each box is slid over the image overlapping the previous placement.
Figure 2b illustrates the basic pattern of scanning using a sliding box. The fixed grid approach can be seen as a sliding box algorithm with the increments horizontally and vertically equal to \epsilon. Sliding box algorithms are often used for analyzing textures in
lacunarity analysis and have also been applied to
multifractal analysis.
Subsampling and local dimensions Box counting may also be used to determine local variation as opposed to global measures describing an entire pattern. Local variation can be assessed after the data have been gathered and analyzed (e.g., some software colour codes areas according to the fractal dimension for each subsample), but a third approach to box counting is to move the box according to some feature related to the pixels of interest. In
local connected dimension box counting algorithms, for instance, the box for each \epsilon is centred on each pixel of interest, as illustrated in
Figure 2c. == Methodological considerations ==