FractalDimension
Measures the fractal dimension represented by objects of a binary image.
Access to parameter description
For an introduction: section Image Analysis.
This algorithm is intended to characterize images whose content is known to be potentially fractal. This is the case of complex and irregular curves that cannot be easily described with traditional geometric tools, and/or of curves that are very similar to a part of themselves at different scales.
The fractal dimension is a statistical quantity that gives an indication of how completely a fractal appears to fill space, as one zooms down to finer and finer scales. A fractal is a rough or fragmented geometric shape that can be split into parts, each of which is (at least approximately) a reduced-size copy of the whole.
This algorithm measures the fractal dimension based on a box counting method. The sizes of the boxes are taken as all the power of 2, from 1 to the lower dimension of the dataset. For instance, for a 1000x1000x81 dataset, the different box lengths will be: 1, 2, 4, 8, 16, 32 and 64. For a given box size, the algorithm considers all adjacent, non-overlapping boxes inside the dataset. The fractal dimension is measured as the slope of the array indicating the number of non-void boxes at each resolution in logarithmic scale.
Notices:
The result is 1 in the case of standard geometric features (straight lines, broken lines, circles,...). Applied to 2D images, the fractal dimension is quite an effective indicator to measure and compare the irregularity and the fragmentation at different magnifications. It is also a good indicator to evaluate how the curve fills the space. The less smooth the curve is, the bigger the fractal dimension.
Caution: This algorithm should not be applied on surfaces but on contours, according to the fractal definition. The useOnlyBorders option should be enabled if the input image is filled.
The result is 2 in case of standard geometric surfaces (cubes, planes, ellipsoids,...). Applied to 3D images, the fractal dimension is quite an effective indicator to measure and compare the roughness of a surface. It is also a good indicator to evaluate how the curve fills the space. The less smooth the surface, the bigger the fractal dimension. It also can be interpreted as a quantification of how complex the surface is and how it fills the space.
Caution: This algorithm should not be applied on volumes but on surfaces, according to the fractal definition. The useOnlyBorders option should be enabled if the input image is filled.
References
Access to parameter description
For an introduction: section Image Analysis.
This algorithm is intended to characterize images whose content is known to be potentially fractal. This is the case of complex and irregular curves that cannot be easily described with traditional geometric tools, and/or of curves that are very similar to a part of themselves at different scales.
The fractal dimension is a statistical quantity that gives an indication of how completely a fractal appears to fill space, as one zooms down to finer and finer scales. A fractal is a rough or fragmented geometric shape that can be split into parts, each of which is (at least approximately) a reduced-size copy of the whole.
This algorithm measures the fractal dimension based on a box counting method. The sizes of the boxes are taken as all the power of 2, from 1 to the lower dimension of the dataset. For instance, for a 1000x1000x81 dataset, the different box lengths will be: 1, 2, 4, 8, 16, 32 and 64. For a given box size, the algorithm considers all adjacent, non-overlapping boxes inside the dataset. The fractal dimension is measured as the slope of the array indicating the number of non-void boxes at each resolution in logarithmic scale.
Notices:
- To obtain comparable results between different analyses, the thickness of outlines should be similar among the studied images. It is recommended that this thickness be as thin as possible while preserving the maximum amount of relevant information.
- Rather than considering all boxes of a given size, the algorithm is applied with contiguous boxes, which allows for a faster estimation. However, this means the measurement is not strictly translation-invariant. However, the deviation should be minimal when applied on a representative volume element.
- Because of the approximation method used for computing the slope of curve, the fractal dimension may sometimes be out of the theoretical range (for example, values less than 1 in the 2D case). This is particularly the case for objects that are localized in a part of the image, while the algorithm is more adapted for textures filling the image field homogeneously.
- This method is not applicable to empty images. The fractal dimension is forced to 0 in this case.
2D definition
The 2D fractal dimension is a number larger than 1 and strictly lower than 2.The result is 1 in the case of standard geometric features (straight lines, broken lines, circles,...). Applied to 2D images, the fractal dimension is quite an effective indicator to measure and compare the irregularity and the fragmentation at different magnifications. It is also a good indicator to evaluate how the curve fills the space. The less smooth the curve is, the bigger the fractal dimension.
Caution: This algorithm should not be applied on surfaces but on contours, according to the fractal definition. The useOnlyBorders option should be enabled if the input image is filled.
3D definition
The 3D fractal dimension is a number larger than 2 and strictly lower than 3.The result is 2 in case of standard geometric surfaces (cubes, planes, ellipsoids,...). Applied to 3D images, the fractal dimension is quite an effective indicator to measure and compare the roughness of a surface. It is also a good indicator to evaluate how the curve fills the space. The less smooth the surface, the bigger the fractal dimension. It also can be interpreted as a quantification of how complex the surface is and how it fills the space.
Caution: This algorithm should not be applied on volumes but on surfaces, according to the fractal definition. The useOnlyBorders option should be enabled if the input image is filled.
References
- K.Falconer. "Fractal Geometry: Mathematical Foundations and Application, Second Edition". John Wiley & Sons, pp. 41-50, 2003.
- K.Harrar, L.Hamami. "The box counting method for evaluate the fractal Dimension in radiographic images". 6th WSEAS International Conference on Circuits, Systems, Electronics, Control & Signal Processing. Cairo, Egypt, pp. 385-389, Dec. 2007.
Function Syntax
This function returns the outputMeasurement output parameter.
// Function prototype. FractalMsr::Ptr fractalDimension( std::shared_ptr< iolink::ImageView > inputBinaryImage, FractalDimension::UseOnlyBorders useOnlyBorders, FractalMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype. fractal_dimension( input_binary_image, use_only_borders = FractalDimension.UseOnlyBorders.YES, output_measurement = None )
This function returns the outputMeasurement output parameter.
// Function prototype. public static FractalMsr FractalDimension( IOLink.ImageView inputBinaryImage, FractalDimension.UseOnlyBorders useOnlyBorders = ImageDev.FractalDimension.UseOnlyBorders.YES, FractalMsr outputMeasurement = null );
Class Syntax
Parameters
Class Name | FractalDimension |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputBinaryImage |
The input binary image. | Image | Binary | nullptr | |||||
useOnlyBorders |
The way to apply the algorithm, considering all point or only object boundaries.
|
Enumeration | YES | ||||||
outputMeasurement |
The output measurement result. | FractalMsr | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); FractalDimension fractalDimensionAlgo; fractalDimensionAlgo.setInputBinaryImage( polystyrene_sep ); fractalDimensionAlgo.setUseOnlyBorders( FractalDimension::UseOnlyBorders::YES ); fractalDimensionAlgo.execute(); std::cout << "fractalDimension: " << fractalDimensionAlgo.outputMeasurement()->fractalDimension( 0 ) ;
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) fractal_dimension_algo = imagedev.FractalDimension() fractal_dimension_algo.input_binary_image = polystyrene_sep fractal_dimension_algo.use_only_borders = imagedev.FractalDimension.YES fractal_dimension_algo.execute() print( "fractalDimension: ", str( fractal_dimension_algo.output_measurement.fractal_dimension( 0 ) ) )
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); FractalDimension fractalDimensionAlgo = new FractalDimension { inputBinaryImage = polystyrene_sep, useOnlyBorders = FractalDimension.UseOnlyBorders.YES }; fractalDimensionAlgo.Execute(); Console.WriteLine( "fractalDimension: " + fractalDimensionAlgo.outputMeasurement.fractalDimension( 0 ) );
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = fractalDimension( polystyrene_sep, FractalDimension::UseOnlyBorders::YES ); std::cout << "fractalDimension: " << result->fractalDimension( 0 ) ;
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) result = imagedev.fractal_dimension( polystyrene_sep, imagedev.FractalDimension.YES ) print( "fractalDimension: ", str( result.fractal_dimension( 0 ) ) )
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); FractalMsr result = Processing.FractalDimension( polystyrene_sep, FractalDimension.UseOnlyBorders.YES ); Console.WriteLine( "fractalDimension: " + result.fractalDimension( 0 ) );