为什么我无法使用Tesseract识别图像中的文字? [英] Why I am not able to recognize text in image using Tesseract?

查看:574
本文介绍了为什么我无法使用Tesseract识别图像中的文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我无法使用Tesseract识别图像中的文字?在调试Initgen之后的代码应用程序不工作。还添加了必需的dll。 exe和testdata文件夹兼容在bin / debug文件夹中设置。我也在使用C#3.5。请点击以下链接:

http://www.dotnetissues.com/2011/09/ocr-in-c-using-googles-tessnet2-fetch.html [ ^ ]





我的代码如下:



string imagename = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+ @ \Images\out.tif;





位图图片=新位图(图片名称);

tessnet2.Tesseract ocr = new tessnet2.Tesseract();

//ocr.SetVariable(\"tessedit_char_whitelist,0123456789); //如果只是数字





ocr.Init(@D:\OCR R& D\OCR \TesseractWindowsTest \ TesseractWindowsTest \bin\Debug \,eng,false); //到



列表< tessnet2.word> result = ocr.DoOCR(image,Rectangle.Empty);

foreach(tessnet2.Word word in result)

Console.WriteLine({0}:{1} ,word.Confidence,word.Text);

Why I am not able to recognize text in image using Tesseract? On debuggin the code after Init case the application isn't working. Required dll is also added. The exe and testdata folder compatible is set in the bin/debug folder. I am using C#3.5 too. Did so following below link:
http://www.dotnetissues.com/2011/09/ocr-in-c-using-googles-tessnet2-fetch.html[^]


My Code is as follows:

string imagename = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Images\out.tif";


Bitmap image = new Bitmap(imagename);
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
//ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only


ocr.Init(@"D:\OCR R & D\OCR\TesseractWindowsTest\TesseractWindowsTest\bin\Debug\", "eng", false); // To

List<tessnet2.word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);

推荐答案

你可以下载这个Tesseract .Net包装器: https://github.com/charlesw/tesseract [ ^ ],并在里面运行OCR示例。可以在 Tesseract-OCR插件 [ ^ ]
You can download this Tesseract .Net wrapper: https://github.com/charlesw/tesseract[^], and run the OCR sample inside. More Tesseract wrapper links could be found on Tesseract-OCR addons[^]


这篇关于为什么我无法使用Tesseract识别图像中的文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆