Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finding distance between skeleton and boundary

I am trying to find maximum width of a curve using openCV in python. I used canny edge detector to get the boundaries of the curve. I have then managed to create a skeleton between them as shown by the red line in the attached image.

image description

I now need to find distance between this skeleton and the white line segments so that i can multiply the max distance by 2 to get the width. In short, i need the length of the blue line.

I tried using distance transform but i do not have a closed contour so i am getting incorrect width. I also tried dilation followed by erosion to get a closed contour but that changes the width of my curve. Stuck on this for a long time. Any help would be highly appreciated.