title: OCR: How to improve accuracy - existing libraries for removing non-text 'furniture', shapes, etc to avoid confusing OCR?
body: <p>I want to remove rectangles etc that enclose text in a screenshot image, so that I can perform optical character recognition to get accurate text from the screenshot.</p>
  
  <p><strong>Background:</strong></p>
  
  <p>I doing this to extract data from a legacy application for use with other applications. This is the only way to get at this data as associated files are in a closed, proprietary, binary format.</p>
  
  <p>I will be using AutoItScript to drive the application to show data in its UI, then I will screenshot this and feed this to tesseract.</p>
  
  <p>I've already had <em>some</em> success in automating the UI, and have been able to use tesseract to get plain ascii text out of the bitmap.</p>
  
  <p>There are several AutoItScripr forum articles discussing its use with tesseract/OCR but not specifically for my question.
  <a href="http://www.autoitscript.com/forum/index.php?s=6c32c3ece12756e635a619cdf175eff9&amp;showforum=2" rel="nofollow noreferrer">http://www.autoitscript.com/forum/index.php?s=6c32c3ece12756e635a619cdf175eff9&amp;showforum=2</a></p>
  
  <p><strong>What I need to do</strong></p>
  
  <p>There are thin, 1-pixel wide rectangles that closely enclose some text, when fed to tesseract, it sees them as I for example for a verticle line of the rectangle.</p>
  
  <p>Any thoughts on how to remove the rectangles, or best practices?</p>
  
  <p>I'm asking if there is a generic command line based toolset to overwrite rectangles, for example, in .png files. I could then pass the .png through this, then pass it to tesseract.</p>
  
  <p><strong>Details on the tesseract release/setup I've used are as follows:</strong></p>
  
  <p>Go here: <a href="http://code.google.com/p/tesseract-ocr/downloads/list" rel="nofollow noreferrer">http://code.google.com/p/tesseract-ocr/downloads/list</a>
  - For the basic english generic character set to get Tesseract up and running and recognising your bitmapped text into ascii text, use tesseract-2.00.eng.tar.gz (current version at time of writing is: "English language data for Tesseract (2.00 and up) Jul 2007 989 KB 84845")</p>
  
  <p><strong>Related questions I have already looked at on Stack Overflow</strong></p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1335581/how-to-give-best-chance-of-success-to-an-ocr-software">How to give best chance of success to an OCR software?</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/2296568/analysis-and-transformation-of-the-image-on-the-basis-of-this-analysis-for-better">Analysis and transformation of the image on the basis of this analysis for better OCR results</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/2268028/reading-characters-off-of-the-screen">Reading characters off the screen</a></p></li>
  </ul>
  
  <p>In these, my question is not completely answered or a commercial solution is being sold. I do not want to consider a commercial solution at this stage.</p>