我已经从Here下载了 tesseract 。当我尝试将 dll 文件添加到 Visual Studio 2012 时,它显示的错误是它不是一个有效的程序集。谁能建议我一些其他的 ocr dll 文件和示例编码。我尝试了很多网站,但我没有找到任何好的网站。然后我找到了这个dll文件tessrect并使用了以下代码
string path = @"C:\pic\mytext.jpg";
Bitmap image = new Bitmap(path);
Tesseract ocr = new Tesseract();
ocr.SetVariable("tessedit_char_whitelist", "0123456789"); // If digit only
ocr.Init(@"C:\tessdata\", "eng", 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);
但是视觉工作室抛出错误,它不是有效的程序集。任何人都可以帮助我...编辑:错误是
Could not load file or assembly 'tessnet2_64, Version=2.0.4.0, Culture=neutral, PublicKeyToken=1550524b5ba07e29' or one of its dependencies. An attempt was made to load a program with an incorrect format.
谢谢n提前