问题描述
我有越来越的tesseract我在Visual Studio 2010中的项目工作的问题。我曾尝试控制台和WinForms和都具有相同的结果。
I am having a problem getting Tesseract to work in my Visual Studio 2010 projects. I have tried console and winforms and both have the same outcome. I have come across a dll by someone else who claims to have it working in VS2010
:
我增加了可在连接中找到后从上面的网站64 DLL的引用。每次我建立我的项目,我得到一个 AccessViolationException
说,一个试图读取或写入受保护的内存。
I am adding a reference to the dll which can be found in the attached to post 64 from the website above. Every time I build my project I get an AccessViolationException
saying that an attempt was made to read or write protected memory.
public void StartOCR()
{
const string language = "eng";
const string TessractData = @"C:\Users\Joe\Desktop\tessdata\";
using (TesseractProcessor processor = new TesseractProcessor())
{
using (Bitmap bmp = Bitmap.FromFile(fileName) as Bitmap)
{
if (processor.Init(TessractData, language, (int)eOcrEngineMode.OEM_DEFAULT))
{
string text = processor.Recognize(bmp);
}
}
}
}
访问冲突异常总是指向如果(processor.Init(TessractData,语言(INT)eOcrEngineMode.OEM_DEFAULT))
。我已经看到了一些建议,以确保该解决方案平台在配置管理器,而且tessdata文件夹位置是完成了斜线,都无济于事设置为 86
。任何想法?
The access violation exception always points to if (processor.Init(TessractData, language, (int)eOcrEngineMode.OEM_DEFAULT))
. I've seen a few suggestions to make sure the solution platform is set to x86
in the configuration manager and that the tessdata folder location is finished with trailing slash, to no avail. Any ideas?
推荐答案
这似乎是tessdata文件夹,它是造成问题的内容。从第一个环节中获得的tessdata文件夹和所有现在工作。
It appeared to be the contents of the tessdata folder that was causing the problem. Obtained the tessdata folder from the first link and all is now working.
这篇关于3的tesseract(OCR) - .NET包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!