Tesseract 3.02无法加载DLL

时间:2013-12-27 02:09:05

标签: c# .net wpf dll wrapper

我正在尝试使用Tesseract .Net wrapper for tesseract-ocr创建一个简单的OCR程序。我尝试了示例项目,它就像一个魅力。 问题是,当我运行我的wpf项目时,发生Unable to load DLL 'libtesseract302': The specified module could not be found.错误与代码无关。我尝试了Dependency Walker广告,它说我缺少3个DLL。它们似乎是Windows DLL,但它们在这里不存在:Windows API Sets知道发生了什么吗?

编辑:

我将目标框架从4.5更改为4,现在这些DLL没有任何问题(完美运行的示例项目是使用.NET Framework 4.0)。

现在的问题是:Failed to initialise Tesseract Engine。如果有帮助,这是我的简单代码:

        try
        {
            using (TesseractEngine engine = new TesseractEngine(@"./tessdata", "eng", EngineMode.Default))
            {
                using (Pix img = Pix.LoadFromFile(filename))
                {
                    using (Tesseract.Page page = engine.Process(img))
                    {
                        text = page.GetText();
                    }
                }
            }

        }
        catch (Exception ex)
        {
            text = ex.Message;
        }
        finally
        {
            conv_text_tb.Text = text;
        }

1 个答案:

答案 0 :(得分:0)

好的,我发现了该错误的修复程序。我将DLL文件的Copy to Output Directory属性和tessdata文件夹中的文件更改为Copy Always。它现在工作得很好。

相关问题