Detecting straight lines in an image
<p>I'm trying to extract a portion of an image separated by straight horizontal lines. The image is of a text document of which most is irrelevant for my purposes. The header portion of the document is usually all that I need and is separated by two straight horizontal lines (the line style does vary slightly with one line or a double line with one thicker than the other.) with one on the top and bottom of the header section. The length of the header section is variable so I cannot set a fixed position.</p>

<p>How do I go about extracting this portion of the image? I've looked into a few things like using Hough Transformations and libraries like OpenCV or Accord.net but all of this seems like overkill for something so simple. I'd prefer not to have to use an additional library if possible.</p>

<p>So ideally,I want to input an image and it gives me the position of every straight horizontal line it detects and then I use that to set the bounds for cropping the image. Can anyone point me in the right direction?</p>