title: How to detect lines accurately using HoughLines transform in openCV python?
body: <p>I am a newbie in both <code>python</code> and <strong><code>opencv</code></strong> and I am facing a problem in detecting lines in the following image, which has strips of black lines laid on the ground:</p>
  
  <p><a href="https://i.stack.imgur.com/aMHlL.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/aMHlL.jpg" alt="enter image description here"></a></p>
  
  <p>I used the following code:</p>
  
  <pre><code>gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  edges = cv2.Canny(gray,50,150,apertureSize = 3)
  print img.shape[1]
  print img.shape
  minLineLength = img.shape[1]-1
  maxLineGap = 10
  lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
  for x1,y1,x2,y2 in lines[0]:
      cv2.line(img,(x1,y1),(x2,y2),(0,255,0),2)
  </code></pre>
  
  <p>but it is unable to detect the lines accurately and only draws a green line on the first black strip from the bottom which does not even cover the entire line,<br>
  also,<br>
  please suggest a way of obtaining the <strong><code>y</code></strong> cordinates of each line.</p>