Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
hi anyone could give me an example of an algorithm for thinning (skeletonization) using OpenCV in C # / C + + or without OpenCV.?
need an algorithm that leave a letter or word with only one pixel wide.
Please can someone help me?

Thank you!
Posted

Beware, thinning is not equal to erosion! You find a good article about thinning here: Thinning Algorithm[^]
 
Share this answer
 
Comments
stib_markc 30-May-12 4:57am    
5! for the link.
nv3 30-May-12 5:02am    
Thanks!
Please try this:

This is a morphological image processing. As an example of algorithm:
Iteratively delete (or erode) pixels inside the object (letter) to shrink it without shortening it or breaking it apart. Note that this is an iterative process. In general, you may stop the iteration after several times. Iterate it 3-5 times gives good and fast result.

You may find third party for this kind of image processing. The following thir party has that function.
http://www.artuxsoft.com[^]
http://www.artuxsoft.com/image-erosion.aspx[^]

Regards.
 
Share this answer
 
you can use distance transform(with chessborad distance metric,seems good.) first, then find the minimum distance points on the image which is will be the skeleton that you want. :)

see also this : http://homepages.inf.ed.ac.uk/rbf/HIPR2/distance.htm[^]

jkchan
http://cgmath.blogspot.com
 
Share this answer
 
Here is an overview See weather this help[^]

This will give an overview
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900