我正在编写一个应用程序,我想读取图像并提取文本。为了测试 porpuses,我传入了一个包含 6 个字符的图像。这是我的代码。
Bitmap image = new Bitmap("eurotext.tif");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "abcdefghijklmopqrstuvwxyz0123456789"); // 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)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);
结果是 100 : ~
我第二次运行它返回:
100:-
请帮忙!!!谢谢