title: Find the end of a curved line in a binary image
body: <p>I'm looking for an algorithm that will detect the end of a curved line. I'm going to convert a binary image into a point cloud as coordinates, and I need to find the end of the line so I can start another algorithm.</p>
  
  <p>I was thinking of taking the average of vectors for the N nearest '1' pixels to each point, and saying that the pixel with the longest vector must be an endpoint, because if a point is in the middle of a line then the average of the vectors will cancel out. However, I figure this must be a problem that is well known in image processing so I thought I'd throw it up here to see if anybody knows a 'proper' algorithm.<a href="https://i.stack.imgur.com/lXeeC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lXeeC.png" alt="enter image description here"></a> </p>