title: Scikit-image: how to reduce broken line segments, overlapping lines?
body: <p>I'm currently working on a project to find straight lines and the length of these lines in an image that looks like this: </p>
  
  <p><a href="https://i.stack.imgur.com/GzCg0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GzCg0.png" alt="random_raw"></a></p>
  
  <p>I used scikit-image package in python trying to find the lines and here are my codes:</p>
  
  <p><code>edges=canny(image[:,:,0], 2, low_threshold=0.6, high_threshold=0.9)
  lines=probabilistic_hough_line(edges, threshold=30, line_length=40, line_gap=1)
  </code></p>
  
  <p>Then I plotted the lines to verify whether I found most of the straight lines</p>
  
  <p>And here's what I got: 
  <a href="https://i.stack.imgur.com/EXbte.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EXbte.png" alt="lines"></a></p>
  
  <p>As one can tell, there are so many overlapping and broken line segments(in multi color) along the lines (black color) on original image. The length of the color line should be equal to the length of black line and there should not be duplicated line segments for each black line.  </p>
  
  <p>I tried cranking all variables such as "threshold", "sigma", "line_length", "gap", etc. but still could not fully get rid of the duplicate line segments. </p>
  
  <p>Could someone give me some hint or direction of what I did wrong and what I am supposed to do regarding this issue, please? Hope my question is not too confusing.</p>
  
  <p>I tried to use Scikit-image because, in my opinion, it's relatively lighter weight than OpenCV. </p>
  
  <p>Thank you in advance. </p>