Skip to content

xshiraori/BoxCount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Box-counting 2D images to compute the fractal dimension

Hausdorff Dimension:

"The Hausdorff dimension is a measure of the "roughness" or "complexity" of a geometric object or a set in a metric space. It helps to describe the scaling properties of fractals and irregular shapes. The Hausdorff dimension can be an integer or a non-integer value, depending on the object being measured. It provides a way to quantify the space-filling properties of an object, particularly when the object does not fit well into traditional Euclidean dimensions (such as points, lines, or planes)."

An example of the computation process can be seen below.

Usage and restrictions

  • The algorithm marks non-white pixels as one and white pixels as zero.
  • To be more precise about the result, it only accepts NxN images as input.
  • PIL and matplotlib required.

Example usage,

from ImageFractalDimension import *

image_name = 'sierpinski_512x512.png'
image_size = 512

image = ImageFractalDimension(image_name, image_size)
print(image.fractal_dim)
image.graph()

Output:

Imgur

While the result is not exactly equal to ln(3) / ln(2) this is the best result I manage to get comparing with other available libraries/packages.

About

estimating the Hausdorff Dimension of a 2D image

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages