title: Python opencv Very long Hough lines
body: <p>I'm trying to obtain hough lines for pentagon, triangle and square. 
  Here is the Edge image obtained from cv2.canny <a href="https://i.stack.imgur.com/T8NSJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T8NSJ.png" alt="enter image description here"></a></p>
  
  <p>Environment : Python 2.7, Opencv 2.4.11</p>
  
  <pre><code>img = cv2.imread("shapes.png")
  grayimg = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  cannygrayimgBlur = cv2.Canny(grayimg, 50, 150)  
  minLineLength = 100
  maxLineGap = 10
  lines =cv2.HoughLinesP(cannygrayimgBlur,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)
  cv2.imshow('img',img)
  cv2.waitKey(0)
  </code></pre>
  
  <p>But the result is super strange. Only the complete edges of the square are drawn.
  <a href="https://i.stack.imgur.com/jMLRQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMLRQ.png" alt="enter image description here"></a></p>