This is my code , extract text:
try
{
var image = new Bitmap(@"D:\Tessnet2\C#\test2.jpg");
var ocr = new Tesseract();
// ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
//@"C:\OCRTest\tessdata" contains the language package, without this the method crash and app breaks
ocr.Init(@"D:\Tessnet2\C#\tessdata", "eng", true);
var result = ocr.DoOCR(image, Rectangle.Empty);
foreach (Word word in result)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
Console.ReadLine();
}
catch (Exception exception)
{
}
Result Output:
146: I-18110
47: 88
How can extract text "Hello"
?
Thanks all.
I had resloved by changed from:
ocr.Init(@"D:\Tessnet2\C#\tessdata", "eng", true);
to
ocr.Init(@"D:\Tessnet2\C#\tessdata", "eng", false);