title: OpenCV - Cropping image after applying Hough line transform
body: <p>I am having trouble working with OpenCV and Python, I am new to the technology. Just some questions, how to crop the image after applying Hough line transform?</p>
  
  <p>Here is my image. I want to crop the image with the ones who are having the red lines.</p>
  
  <p><a href="https://i.stack.imgur.com/n5uH0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n5uH0.jpg" alt="enter image description here"></a></p>
  
  <p>Here is my code for cropping image, and I know there is something wrong.</p>
  
  <pre><code>minLineLength = 100
  maxLineGap = 10
  rho = 1
  theta = np.pi/180
  threshold = 190
  lines = cv2.HoughLines(opened, 1, np.pi/180, threshold)
  for line in lines:
      for rho,theta in line:
          a = np.cos(theta)
          b = np.sin(theta)
          x0 = a*rho
          y0 = b*rho
          x1 = int(x0 + 1000*(-b))
          y1 = int(y0 + 1000*(a))
          x2 = int(x0 - 1000*(-b))
          y2 = int(y0 - 1000*(a))
          cv2.line(image, (x1, y1), (x2, y2), (255, 0, 0), 2)
          cropped = image[100:200, 500:640]
  </code></pre>
  
  <p>I really need your help guys</p>