First time here? Check out the FAQ!

Ask Your Question
1

Get skeleton from distance transform

asked May 31 '16

manatttta gravatar image

updated Sep 17 '0

Hello,

I know it is possible to get the skeleton of a shape in an image from either successive morphological operations or distanceTransform. I can do this via morphological operations. But How do I do this via distanceTransform?

Right now I have:

cv::Mat input = (...);
cv::Mat output;

cv::distanceTransform(input, output, ...);

Now, how do I get the skeleton from the image transform in output?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
5

answered May 31 '16

updated Nov 25 '16

i suggest you to use Zhang-Suen thinning algorithm or Guo-Hall thinning algorithm


added by @StevenPuttemans

and if you want an example for that exact thinning at work, take a look here where it is used for fingerprint skeletization.

EDIT:

now cv::ximgproc::thinning (Zhang-Suen algorithm) is in the contrib library.

also take a look at this github repository

Preview: (hide)

Comments

@sturkmen Thank you very much, very good algorithm!

manatttta gravatar imagemanatttta (Jun 1 '16)edit

ah this reminds me that I should update thinning to contain both systems :D

StevenPuttemans gravatar imageStevenPuttemans (Nov 25 '16)edit

Question Tools

2 followers

Stats

Asked: May 31 '16

Seen: 3,055 times

Last updated: Nov 25 '16