title: Cropping images in opencv
body: <p>I have an image that has some text in it. I want to send the image to OCR but the image has some white noise in it so the OCR results aren't that great. I've tried to erode/dilate the image but couldn't get the perfect threshold to work. Since all the text in the images will be perfectly horizontal I tried the Hough Transform. </p>
  
  <p>Here is what the image looks like when I run the sample hough transform program bundled with OpenCV. </p>
  
  <p><strong>Question</strong></p>
  
  <ul>
  <li><p>How can I black out everything <strong>except</strong> where the red lines are? 
  <strong>OR</strong> How can I crop out a separate images for each of the areas highlighted by the red lines?</p></li>
  <li><p>I would only like to concentrate on lines that are horizontal, I can discard the diagonal lines. </p></li>
  </ul>
  
  <p>Either option will work for me when sending to OCR. However, I'd like to try both to see which fetches best results.</p>