Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCR on a screenshot

Tags:

c#

screenshot

ocr

I need to convert an image to text. But it's a bit easier than it seems.

The image I'm talking about is not a scanned document or something that is rotated, skewed, and up-side-down. It's a clean screenshot from a game (similar to taking a screenshot of a some text in notepad). I also know exactly how big the text is and where it is, it is also very easy to remove the background and make black on white.

The font will always stay the same (however, I don't know which font). so maybe I could teach something it to read this specific font?

I also need this to be called from a c# application. so I'm looking for some way in c# to say: here's the Bitmap (or path to a bitmap), give me what it says in plain text.

I already tried that tesseract ocr, but it seems that I'm doing something wrong, because it is almost always wrong. The only one that had good results (only a small mistake with having an "at" becoming "a t") was Capture2Text, but I have no idea how to use that in c#.

here's a small sample of what it should be able to read: http://i.imgur.com/PdEGznk.png

like image 422
user2839747 Avatar asked Feb 01 '14 11:02

user2839747


1 Answers

I use Tesseract.NET to recognize your sample image and got "Evorvze SWOYG"; after rescaling it to 300DPI, got "Bronze sword".

like image 146
nguyenq Avatar answered Oct 22 '22 11:10

nguyenq