DoOCR在C#中关闭活动应用程序

时间:2015-01-31 23:01:32

标签: c# image ocr tessnet2

我正在开发C#中关于OCR的应用程序。

我使用Tessnet2作为OCR引擎,这是我的代码:

Bitmap image = new Bitmap(pictureBox1.Image);
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
ocr.Init(@"C:\Users\Mari\Documents\Visual Studio 2010\Projects\ocr\ocr\bin\Release", "eng", false); // To use correct tessdata
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);

        foreach (tessnet2.Word word in result)
        {
            richTextBox1.Text = string.Format("{0} : {1}", word.Confidence, word.Text);
        }

执行此代码时,应用程序立即关闭,没有任何错误。 有人可以建议做什么吗? 感谢

0 个答案:

没有答案