Does anyone know an easy way, given a binary image, to construct a transform which for each point on the boundary (contour set pixel) returns the point on the medial axis that it is closest to?
Asked
Active
Viewed 450 times
1 Answers
0
I don't know which language you are using for your program, but you can use python.
with the scikit-image library it will be really easy.
First of all, you have to calcul all the component label (optional, depends on your binary image) thanks to the methods : skimage.morphology.label(image, return_num=True)
after that you can calculate each medial axis thanks to : skimage.morphology.medial_axis(img, return_distance=True)
so at this point you've got sets of points with contour pixel and sets of points with medial-axis pixel.
You just have to calculate for each component label a distance between pixel you want and all pixel in set of medial axis dist=sqrt((y2-y1)^2+(x2-x1)^2)
I hope it will help you.

Diane Delallée
- 123
- 2
- 9