# Revision history [back]

### Get skeleton from distance transform

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?

 2 retagged sturkmen 6772 ●3 ●48 ●79 https://github.com/stu...

### Get skeleton from distance transform

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?