1
我想在c#应用程序中使用tessnet2从图像中读取文本。 这是我的代码:Tessnet2 OCR只返回数字
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++源代码中。...... – devHead 2013-04-05 13:55:57