title: Get polygons from edges in OpenCV
body: <p>I have an image I want to extract lines from (a vascular network), using the Hough line algorithm. First I preprocess the image, then use Canny edge detection to generate the binary image.</p>
  
  <p><img src="https://i.imgur.com/pJrCoIt.jpg"></p>
  
  <p>I want to get a polygon/an array of joined line segments representing the shape of the vascular network. However applying the Hough line transform directly on this image yields mediocre results, partly because edge detection means each vessel is represented by two lines on each side, instead of a single line.</p>
  
  <p>I'm new to OpenCV and image processing in general, so I'm probably going about this the wrong way. Any suggestions, or any recommended literature?</p>