Find the length, thickness and center of mass of a line

I need to find the length of the skeleton of the line, the thickness of the line (minimum, maximum, average) and the center of mass of the object.
found skeleton (in white):
res

Can you please tell me, maybe there are already ready-made solutions for these tasks? or if you write your own algorithm, give advice on where to start. thanks in advance!

1 Like

I have the same question. If anybody knows how to do it, I would greatly appreciate the help.

For those interested, my application is in-focus edge detection. Regular gradient thresholding doesn’t work well in my case, so I want to detect edges based on the criterion that in-focus edges have the minimum thickness. This is why I need to know how, in general, would one find the width of a line in opencv python.