File Exchange

image thumbnail

Fractal dimension

version 1.0 (2.26 KB) by

Generating a fractal dimension image using box counting algorithm



View License

The program transforms an input image using the differential box counting algorithm to a fractal dimension (FD) image, i.e. each pixel has its own FD. Then the user can select any region of interest in the generated FD image to estimate the corresponding mean, standard deviation and lacunarity.

Comments and Ratings (9)

Omar Al-Kadi

Many thanks Nicolas for the interesting remark!

The code gives an estimation of the roughness of the image surface, and this results in sometimes not having an exact fractal dimension (FD) value. This is mainly due to how the FD is estimated via the box-counting algorithm, i.e. a region is specified around each pixel, and a parametric FD image map is estimaed for each corresponding pixel in the original image. However, experimenting with the scaling factor to how far an image can be probed for self-similarity can assist for a more accurate estimation of the FD. For more information, please see Fig. 2 in the following article:

Hi Omar,

I tried few things out of curiosity and I found something intriguing. I created an input image of a uniform red square, expecting a resulting fractal dimension of 2. The output FD was 1,92 with very small standard variation (10^-12). Is there a problem with my understanding of fractal dimensions?

By the way, the code is very nice!

jithin raj

nicely done ..thanks a lot...


@Rajkumar Why to use this for signal processing? There are algorithms based on kNN, Higuchi's method and Multi-resolution box count that can perform much better for time series data.

can this algorithm be used for signal processing? if yes then how?


akar (view profile)

Omar Al-Kadi

Thanks Martin, and I'm happy you found the script useful.
Yes as you guessed, the standard deviation mainly depends on the type of image you anslyse. That is, the more homogeneous the texture in the image is, the more homogeneous the Fractal dimension becomes, and thus the lower the standard deviation; and vice versa. To check, try to apply the script to images with different textures (e.g. rough and fine) and compare your results.

Kind regards, 

Martin V.

Martin V. (view profile)

Thanks for useful script.
But the estimate of fractal dimension has large standard deviation in many case when I used this script. Is it a proprerty of box-method or it depends on source image?
Thank for respond.

MATLAB Release
MATLAB 7.9 (R2009b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today