title: Reduce an image to paths defined by a collection of points
body: <p>I'm currently trying to represent an image like the one below as a point defined path. Every &quot;trace&quot; should be a separate path. <em>See picture below</em>
  <a href="https://i.stack.imgur.com/ZteBP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZteBP.jpg" alt="Picture 1" /></a></p>
  <p>The thing I'm trying to do right now is using scikit-image and scipy in python to fill up and skeletonize the image. <em>See picture below</em>
  <a href="https://i.stack.imgur.com/WvJXa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WvJXa.png" alt="Picture 2" /></a></p>
  <pre class="lang-py prettyprint-override"><code>import os
  from skimage import io, img_as_bool
  from scipy import ndimage
  from skimage.morphology import skeletonize
  from skimage.util import invert
  from matplotlib import pyplot as plt
  
  filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'traces.png')
  traces = io.imread(filename, True)
  inverted = invert(traces)
  boolimage = img_as_bool(inverted)
  image = ndimage.binary_fill_holes(boolimage)
  skeleton = skeletonize(image, method='lee')
  
  plt.imshow(skeleton, cmap=plt.cm.gray)
  plt.axis('off')
  plt.show()
  </code></pre>
  <p>The skeleton however has many curving lines and I currently do not know how to proceed into cleaning it up into straight lines and angles so the lines endpoint can be used to record the paths. I have tried probabilistic Hough transform from scikit to obtain lines but these struggles with the bending nature of the lee skeleton and complete leaves out geometry.</p>
  <p><strong>Any help would greatly be appreciated</strong>, if you have any completely different ideas or some algorithm names those are also very much welcome!</p>