I am trying to track/ trace boundary points in sequence from the following binary image:
I am using OpenCV (python). I am using three ways:
- Apply Canny edge detection to detect edge. Problem is how to get the sequence of points? It's work fine but it's very hard to get the sequence of boundary points
- Ideal option is to detect contours on the binary image. Because contours return the boundary points in sequence. But openCV contour method is not detecting the boundary as shown in the results. Why is this happening?
- Detect contours on the Canny edge. Still some boundary is missed ??
Can anyone help me what's going on with OpenCV contours? Why it is not tracking the complete boundary. I am detecting contours as follows:
contours, hierarchy = cv2.findContours(thresh1,cv2.RETR_TREE ,cv2.CHAIN_APPROX_SIMPLE)
where thresh1 is the binary image