點選打開連結
l dimension of natural objects from digital images
up vote 42 down vote favorite 18 | This is a useful topic. A college physics lab, medical diagnostics, urban growth, etc. - there is a lot of applications. On this site by Paul Bourke about Google Earth fractals we can get a high resolution images (in this post they are low res - import from source for experiments). For example, around Lake Nasser in Egypt: The simplest method I know is Box Counting Method which has a lot of shortcomings. We start from extracting the boundary - which is the fractal object: Now we could partition image into boxes and see how many boxes have at least 1 white pixel. This is a very rudimentary implementation: From this the slope is 1.69415 which is a fractal dimension that makes sense 13.0276 + 1.69415 x Benchmark: if I run this on high res of Koch snowflake i get something like ~ 1.3 with more exact number being 4/log 3 ≈ 1.26186. Question: can we improve or go beyond the above box counting method? All approaches are acceptable if they find fractal dimension from any image of natural fractal. image-processing physics fractals
| |||
|
You can still use box count, but doing it smarter :) Counting boxes with at least 1 white pixel from can be done more efficiently usingIntegral Image, a technique used by Viola-Jones (2004) in their now popular face recognition framework. For a mathematical motivation (and proof), Viola and Jones point to this source. Actually, someone already asked about a Mathematica implementation here. What Integral Image allows you to do is to compute efficiently the total mass of any rectangle in an image. So, you can define the following: Then, the mass (white content) of a region, is So, instead of partitioning the image using , you can get a list of all the boxes of a given size by If you apply to above, as in your algorithm, you should have the same data but calculated faster. Following your approach here, we should then do which is very close to the actual fractal dimension of the snowflake (which I used as input). Two things to note. Because this is faster, I dared to generate the table at box size 3. Also, unlike , my partition boxes are all of the same size and therefore, it excludes uneven boxes at the edges. So, instead of doing as you did, I put - excluding bigger and misleading values for big boxes. Hope this helps. Update Just ran the algorithm starting with 2 and got this . And starting with 1 is , much better. Of course, it takes longer but still under or around 1 min for your snowflake image. Update 2 And finally, for your image from Google Earth (eqypt2.jpg) the output is (starting at 1-pixel boxes) It ran in 43.5 secs in my laptop. Using is faster: around 28 secs.
| ||||||||||||
|