Welcome to Fractal Forums

Fractal Software => Help & Support => Topic started by: clueso on June 15, 2007, 11:11:28 AM




Title: Help with the Mass Radius method
Post by: clueso on June 15, 2007, 11:11:28 AM
Hello Everyone,

I am currently working on a project where I need to do extract the fractal dimension from greyscale images. I have some MATLAB code for running the mass radius method to computing the same.

the code basically starts from a fixed point(centre of image) and considers concentric circles with increasing radii (R).For each circle, the number of pixels which are "set" and which lie inside the circle are counted (N) and then finally the dimension if extracted from a log-log plot of N v.s R. However, I read in a paper that the number of pixels which are not set should also be counted but i am unsure as to how this data can be used.

If anyone has some good links on the mass-radius method or even some code/pseudocode and can pass it on, it would be a great help.

Thanks in advance.


Title: Re: Help with the Mass Radius method
Post by: lycium on June 15, 2007, 05:47:53 PM
some links from the ever-useful paul bourke, in rough order of perceived usefulness:

http://local.wasp.uwa.edu.au/~pbourke/fractals/multifrac/
http://local.wasp.uwa.edu.au/~pbourke/fractals/fracdim/
http://local.wasp.uwa.edu.au/~pbourke/fractals/compass/


Title: Re: Help with the Mass Radius method
Post by: Nahee_Enterprises on June 16, 2007, 12:14:29 AM
Hello Everyone, .....

Greetings and welcome to this Forum!!    :)

It looks like Thomas Ludwig (lycium) has got you off to a good start with those links.  If you need some more references, let us know.




Title: Re: Help with the Mass Radius method
Post by: clueso on June 18, 2007, 07:43:10 PM
The references were quite helpful, but more importantly I discovered a bug in the program I was using and fixing that kind of took care of my problems :P

But there is still a technical curiosity I have. The site by Bourke also mentions measuring the "mass" in a circle of a certain radius. But what is the best way to define the "mass" in an image? I am simply increasing the mass by 1 everytime I find a "set" pixel and I ignore the ones that are not set. This yields decent results than counting a set pixel as "2" and an unset one as "1" (the only other case I tried), but in case anyone has some better ideas I am keen to know.

Thanks for the help on my last query :)



Title: Re: Help with the Mass Radius method
Post by: lycium on June 19, 2007, 05:24:40 AM
definitely count 1 as mass and 0 as not! ;)

regarding the inside/outside counting, i think you can considerably improve the accuracy of this estimate, especially for small circles, if you consider sub-pixel converage. that is, if you have a set pixel which overlaps the circle boundary, consider the fractional area of the overlap instead of just 0 or 1. i worked out and simplified the equations for this some years ago using stokes' theorem, for drawing anti-aliased (or "blurred" as it is known on these forums ;)) circles, and it was quite fast as you only need to compute it on the boundary.

of course, you can approximate this analytical answer to any degree of accuracy desired by simply increasing the resolution of your source image, which has the added benefit of giving a truer estimate of the actual "mass of the fractal". beyond this you can actually plot the fractal in a sub-pixel-correct manner and consider that weight in addition to the area-weighting above...


edit: sorry, i meant green's theorem; stokes' theorem is the next one up.


Title: Re: Help with the Mass Radius method
Post by: Nahee_Enterprises on June 19, 2007, 07:36:45 PM
i worked out and simplified the equations for this some years ago using stokes' theorem,
for drawing anti-aliased (or "blurred" as it is known on these forums ;)) circles.....

I do not mind the use of anti-aliasing, when it is done well.   ;)
Just have a concern when an image from the M/J-Set has been blurred to the point of appearing as if it was a "flame" fractal.   :D

It all stems from my life of wearing glasses for near-sightedness (been that way since I was a young child).  I prefer things not to look like I was not using my corrective lenses.    ;D



Title: Re: Help with the Mass Radius method
Post by: David Makin on August 02, 2010, 05:20:18 AM
The references were quite helpful, but more importantly I discovered a bug in the program I was using and fixing that kind of took care of my problems :P

But there is still a technical curiosity I have. The site by Bourke also mentions measuring the "mass" in a circle of a certain radius. But what is the best way to define the "mass" in an image? I am simply increasing the mass by 1 everytime I find a "set" pixel and I ignore the ones that are not set. This yields decent results than counting a set pixel as "2" and an unset one as "1" (the only other case I tried), but in case anyone has some better ideas I am keen to know.

Thanks for the help on my last query :)



Maybe by "mass" he means somehow use the number of hits on a given pixel rather than simply counting a hit pixel as 1.
However you'd have to have a way of adjusting the range of hit counts so that equivalent results are acheived independantly of the number of total iterations (given a minimum number of iterations).