title: Delete segmented lines (OpenCV, Python)
body: <p>Given the followig code:</p>
  
  <pre><code>import numpy as np
  import cv2
  
  gray = cv2.imread('image.png')
  edges = cv2.Canny(gray,50,150,apertureSize = 3)
  cv2.imwrite('edges-50-150.jpg',edges)
  minLineLength=100
  lines = cv2.HoughLinesP(image=edges,rho=1,theta=np.pi/180, threshold=100,lines=np.array([]), minLineLength=minLineLength,maxLineGap=80)
  
  a,b,c = lines.shape
  for i in range(a):
      cv2.line(gray, (lines[i][0][0], lines[i][0][1]), (lines[i][0][2], lines[i][0][3]), (0, 0, 255), 1, cv2.LINE_AA)
      cv2.imwrite('houghlines.jpg', gray)
      cv2.imshow('img', gray)
      cv2.waitKey(0)
  </code></pre>
  
  <p>I can achieve the horizontal lines that there are in this (source) image:</p>
  
  <p><a href="https://i.stack.imgur.com/nTxd9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nTxd9.png" alt="src"></a></p>
  
  <p>This is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/fi6Gd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fi6Gd.jpg" alt="result"></a></p>
  
  <p>How can I delete the lines which are in red ? What I want to achieve is to delete these lines so the image is more clean and ready to use by another process.
  The code has been taken from <a href="https://stackoverflow.com/questions/39752235/python-how-to-detect-vertical-and-horizontal-lines-in-an-image-with-houghlines-w">here</a>.</p>