I'm trying to find arc length of a vessel by choosing two points on it.
The function cv.ArcLength()
raises the following exception:
TypeError: All elements of sequence 'curve' must be same size
Here is my code:
contours,hierarchy = cv2.findContours(edges,cv2.RETR_TREE,cv2.CHAIN_APPROX_NONE)
adist=cv.ArcLength(contours,(x1,x2), isClosed=-1)
The values of the variables x1
and x2
were obtained from a mouse event.
Does anyone know the solution? Is it possible to find the arc length by integration on an irregular curve?