The files in this package comprise the Matlab implementation of a method for skeletonizing binary images. These are my own implementation
of a skeletonization method communicated to me by Alex Telea
(http://www.win.tue.nl/~alext/). See his papers for more details.
Skeletonization is (roughly speaking) the "thinning" of a binary image or silhouette to a one-pixel width spine. The image processing toolbox provides support for skeletonization via the bwmorph function, but its results do not always conform with our intuition. I have found that the approach used herein usually generates a more pleasing result.
There is also a routine for locating endpoints and junctions in skeletonized images.
(Note: This code has not been optimized for speed.)
Bug fix 7/18/07: In rare instances, isolated points would incorrectly be assigned an infinite value for skg.
Telea, A., van Wijk, J.J.: An Augmented Fast Marching Method for Computing Skeletons and Centerlines. Proc. IEEE VisSym (2002) 251–258
I tried to run it as
>> [skr,rad] = skeleton(lala);
where lala is my image but I get the following error
Attempt to execute SCRIPT skeleton as a function:
and don't know why. What am I doing wrong?
One thing not clear is how to set the threshold. Have to find it in trial-and-error manner. Once getting the threshold value, it gave me very good results.
Works great - how about the function skelgrad to determine the local radius at each point? This would be very useful!
Matlab's built-in skeletonization is quirky as all hell and this is a necessary contribution, but this algorithm takes a beating on images over 512x512 with significant amounts of material to skeletonize. I cut it off after 5 minutes, which is pretty much unacceptable for a c++ file. You'll need to look elsewhere for high-throughput applications. I'll be trying this next:
Could you tell me the name of the Alex Telea's paper of the references please?
Thank you but the url of Alex Telea's paper dont work.
Has the tool & algorithm been published? If yes, would you please to mention the reference. Thanks a lot for the tool!
Nice work, but can I ask you something. How we may compute the threshold (you demostrate in demo file) automatically according to the given object nowing only its shape apriori? Can you give the exact reference of the algorithm?
i got it already. It works. Thank you
I have try other compiler.I'm using mic studio professional 2008. It seems it is still the same..
how to solve it?
With regard to my question above (15 Sep 2009), I think I've figured it out -- it looks like the local radius output of the function skeleton() is actually the radius SQUARED. Take the sqrt to get the radius in pixels.
This package is very useful.
A question: does anyone know what the local radius values correspond to, or what units they are measured in? They are not in pixels.
It is very good. I have suggestions for additional features if you are interested in collaboration.
For those having trouble compiling skeleton.m and anaskel.m, I had the same issue at first. The Lcc-win32 C 2.4.1 compiler that comes with MATLAB wouldn't compile these files. You'll have to try a different compiler. These files compiled just fine for me after I chose Microsoft Visual Studio 2008 in mex -setup.
I am a Matlab novice, having said that, this code also doesn't work for me, i ran the mex setup, chose a compiler, changed the file path names in skeleton.m and anaskel.m to the correct ones for the cpp files (from the download) - do I need to make any modifications in the C-code? how does it read the image?
I get lots of errors from the .cpp files
it works. you have to modify and run first skeleton.m and anaskel.m as they contain absolute path to the two cpp files for compilation.
This thing do not work right. Can someone help me? I am getting those errors:
??? Attempt to execute SCRIPT skeleton as a function:
Error in ==> demo at 9
Thanks for your contribution
Nice. For me it turns out that anaskel is the useful routine after all. I'm glad I tried it!
In rare instances, isolated points would incorrectly be assigned an infinite value for skg.