1

请不要标记 -ve 这是基本的。嗨,在我的 Visual Studio2012 中,我使用 tessnet2 库进行 ocr 但无法编译代码。我看过 http://www.pixel-technology.com/freeware/tessnet2/ 并进行了所有设置。我也将 tessdata 文件夹放在了我的 .exe 目录中。我还安装了 Microsoft Visual c++ 2008 可再发行包(x86 和 x64)。我的系统是64位的。我还尝试通过删除 x86 仅使用 x64 包。我在我的设置中使用 .net4.5。我还在我的项目设置中尝试了其他框架。我也在我的项目设置中尝试过 x86orx64 或两者。我有这个代码

Bitmap image = new Bitmap("C:\\Users\\Amna\\Documents\\text.tif");
tessnet2.Tesseract ocr = new tessnet2.Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
ocr.Init(@"c:\temp", "fra", false); // To use correct tessdata
List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
foreach (tessnet2.Word word in result)
Console.WriteLine("{0} : {1}", word.Confidence, word.Text);

但我收到此错误:无法加载文件或程序集 'tessnet2_64, Version=2.0.4.0, Culture=neutral, PublicKeyToken=1550524b5ba07e29' 或其依赖项之一。该系统找不到指定的文件。我 在 C# IIS 7.5 Fixing 中也看到了这些链接 Tessnet2 错误 尝试加载格式不正确的程序问题? 还有很多。

4

1 回答 1

1

Do you absolutely have to use the x64 version? I was having a lot of issue until I changed to using x86 version of the Tessnet2 (tessnet2_32.dll). I also changed my .NET framework target to 2.0. and making sure that the target platform is x86 architecture. I also had to make sure that I have the correct language data in tessdata folder where the program executable is. The data must also be a tesseract 2 data and not tesseract 3 data.

于 2014-01-23T19:48:24.650 回答