Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 769137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:17:20+00:00 2026-05-14T18:17:20+00:00

I want to remove rectangles etc that enclose text in a screenshot image, so

  • 0

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.

Background:

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.

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.

I’ve already had some success in automating the UI, and have been able to use tesseract to get plain ascii text out of the bitmap.

There are several AutoItScripr forum articles discussing its use with tesseract/OCR but not specifically for my question.
http://www.autoitscript.com/forum/index.php?s=6c32c3ece12756e635a619cdf175eff9&showforum=2

What I need to do

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.

Any thoughts on how to remove the rectangles, or best practices?

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.

Details on the tesseract release/setup I’ve used are as follows:

Go here: http://code.google.com/p/tesseract-ocr/downloads/list
– 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”)

Related questions I have already looked at on Stack Overflow

  • How to give best chance of success to an OCR software?

  • Analysis and transformation of the image on the basis of this analysis for better OCR results

  • Reading characters off the screen

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:17:20+00:00Added an answer on May 14, 2026 at 6:17 pm

    There’s probably not going to be a free off the shelf solution for this, but coding your own shouldn’t be too hard since it’s probably safe to assume that a rectangle will never be a valid character in your font’s alphabet and can therefore be removed safely. It also helps that all your rectangle borders are exactly one pixel wide.

    So search for a contiguous horizontal line that is joined to another, parallel line of the same length by exactly two vertical lines. Repeat the search until you find all the rectangles in the image then render them all transparent with Graphics.DrawRectangle and Pens.Transparent. Don’t render a rectangle transparent until you’ve finished searching else you risk wiping out parts of overlapped rectangles before you’ve found them. This is just a starter suggestion, I haven’t implemented or debugged this algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want remove "Language" querystring from my url. How can I do this? (using
I have an datetime object that I want to remove one hour to display
I want to remove a UIView from a superview and add it again at
I'm using subversion (TortoiseSVN) and I want to remove the .svn folders from my
I have a bunch of java files from which I want to remove the
Imagine I have String in C#: I Don’t see ya.. I want to remove
have downloaded Orca to edit an MSI file. I want to remove some banner
im building a new side with movable type. And i want to remove the
I have an ArrayList<String> , and I want to remove repeated strings from it.
I want to use the Publish.GacRemove function to remove an assembly from GAC. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.