forever
forever

Reputation: 43

Improving Tesseract OCR accuracy on screenshot

The tesseract OCR on screenshots gives rather erratic results. Only some of the text seems to be recognized correctly even though the image is completely black with white text over it. Even after I resize the image to 300dpi the accuracy remains low and most of the text is gibberish.

I read the similar question on StackOverflow at: Best way to recognize characters in screenshot?

As mentioned, the writer of the question was able to get nearly 100% accuracy by training the tesseract engine with his font.

The font in my image is Arial. How can I still improve the accuracy???

Here is a sample of the kind of Images I have: Image Sample

Upvotes: 2

Views: 7062

Answers (2)

Anton K.
Anton K.

Reputation: 1

The issue is old, but comes first in google search, so I thought, I'd answer. I had a very similar issue, thought I'd go crazy, but then by chance found this page: https://tesseract-ocr.github.io/tessdoc/ImproveQuality

There it says: Inverting images While tesseract version 3.05 (and older) handle inverted image (dark background and light text) without problem, for 4.x version use dark text on light background.

I negated the image with ImageMagick and there we go: 100% match!

Upvotes: 0

sameer maurya
sameer maurya

Reputation: 121

You can play around with the configuration of the OCR by changing the --psm and --oem values

try: --psm 5 --oem 2

you can also look at the following link for further details here

Upvotes: 1

Related Questions