tessnet2加载失败 [英] tessnet2 fails to load

查看:468
本文介绍了tessnet2加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用tessnet2包装器在Windows XP上的Tesseract 2.04 Source,
配置为使用x86。



TessarctTest项目main函数包含:

 位图bmp = new Bitmap(@C:\temp\New Folder\dotnet\eurotext.tif ); 
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
// ocr.SetVariable(tessedit_char_whitelist,0123456789);
ocr.Init(@C:\temp\tessdata,eng,false);
// List< tessnet2.Word> r1 = ocr.DoOCR(bmp,new Rectangle(792,247,130,54));
List< tessnet2.Word> r1 = ocr.DoOCR(bmp,Rectangle.Empty);
int lc = tessnet2.Tesseract.LineCount(r1);

当我尝试运行程序时崩溃在ocr.Init

  int result = m_myTessBaseAPIInstance-> InitWithLanguage((char *)_ tessdata.ToPointer(),NULL,(char *)_ lang.ToPointer ),NULL,numericMode,0,NULL); 

任何人都有想法?



喜欢!

解决方案

对于在所有这些之后仍然有问题的任何人,请确保如果您使用tessnet2, 正确的语言文件 Tesseract 3.01版的英语语言数据版本。我希望这可以节省你几个小时! :)


i'm using the tessnet2 wrapper to the Tesseract 2.04 Source on windows XP, configured it to work with x86.

TessarctTest project main function contains:

        Bitmap bmp = new Bitmap(@"C:\temp\New Folder\dotnet\eurotext.tif");
        tessnet2.Tesseract ocr = new tessnet2.Tesseract();
        // ocr.SetVariable("tessedit_char_whitelist", "0123456789");
        ocr.Init(@"C:\temp\tessdata", "eng", false);
        // List<tessnet2.Word> r1 = ocr.DoOCR(bmp, new Rectangle(792, 247, 130, 54));
        List<tessnet2.Word> r1 = ocr.DoOCR(bmp, Rectangle.Empty);
        int lc = tessnet2.Tesseract.LineCount(r1);

when i try to run the program it crashes on the following line inside the ocr.Init

int result = m_myTessBaseAPIInstance->InitWithLanguage((char *)_tessdata.ToPointer(), NULL, (char *)_lang.ToPointer(), NULL, numericMode, 0, NULL);

Any one has an idea?

Appreciate!

解决方案

For anyone still having a problem after all these, make sure if you're using tessnet2 that you download the correct language files.

You want English language data for Tesseract (2.00 and up) and not the English language data for Tesseract 3.01 version. I hope this saves you a few hours! :)

这篇关于tessnet2加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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