0

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: ~" ?

Grant Winney
  • 65,241
  • 13
  • 115
  • 165
zuh4n
  • 448
  • 1
  • 4
  • 11
  • As far as I've experienced `Tesseract` sucks fairly seriously, I would not use such an unreliable library. – King King Dec 09 '13 at 12:46
  • @GrantWinney you're right but I think Image bad quality. – zuh4n Dec 09 '13 at 12:51
  • Before passing your image to tesseract, try to binarize it first, it helps a lot – OuSs Feb 17 '14 at 13:43
  • 1
    @KingKing Tesseract is very stupid about preprocessing of the input image, but works pretty well if the image is adjusted first. It needs to be rotated to horizontal, blown up in resolution, and have low-frequency brightness changes removed before being run through the engine. – endolith May 24 '14 at 14:33

1 Answers1

1

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.

a.h
  • 11
  • 1