【发布时间】:2013-04-05 13:45:55
【问题描述】:
我正在尝试在 c# 应用程序中使用 tessnet2 从图像中读取文本。 这是我的代码:
string valoare="";
lblOCR.Text = "";
Bitmap image = new Bitmap(@"C:\Stamp\test.png");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.Init(@"F:\Manipulare pdf\bin(1)\Release32\tessdata", "eng", false);
var rect = new System.Drawing.Rectangle();
List<tessnet2.Word> result = ocr.DoOCR(image, rect);
int lc = tessnet2.Tesseract.LineCount(result);
foreach (tessnet2.Word word in result)
{
lblOCR.Text += word.Text+" "+word.Confidence+"<br/>";
}
结果字符串只包含数字,但我的图片包含字母,我不明白为什么。
谢谢
【问题讨论】:
-
可能与图像的方向有关吗?我不确定他们是否为 C# 包装器实现了“自动”方向,我知道它在 C++ 源代码中......