Tesseract image to text

2.2k Views Asked by At

I use this code:

Bitmap image = new Bitmap(Application.StartupPath + "\\" + "1111.jpg");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
// ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
ocr.Init(null, "eng", false); // To use correct tessdata
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
    MessageBox.Show(String.Format("{0} : {1}", word.Confidence, word.Text));

But answer is: 100: ~ This load image:

enter image description here

Why answer is "100: ~" ?

1

There are 1 best solutions below

0
On

The size of your text is too small. So the result is "~" for the scanned text. If you use a bigger font (like 14 or 16) tessnet2 work really good.