zoukankan      html  css  js  c++  java
  • Unable to load DLL 'opencv_core290'

    问题:

    In my winforms application I need to use some Emgu.CV libraries (I have installed Emgu 2.9).

    Problem is that I get the following error:

    System.TypeInitializationException was unhandled
         HResult=-2146233036Message=The type initializer for'Emgu.CV.OCR.Tesseract' threw an exception.Source=Emgu.CV.OCR
         TypeName=Emgu.CV.OCR.TesseractStackTrace:
             at Emgu.CV.OCR.Tesseract..ctor(String dataPath,String language,OcrEngineMode mode)
             at ANPR.LicensePlateDetector..ctor(String dataPath)in c:UserslablaVisual Studio2012ProjectsANPRANPRLicensePlateDetector.cs:line 30
             at ANPR.Form1..ctor()in c:UserslablaVisual Studio2012ProjectsANPRANPRForm1.cs:line 22InnerException:System.TypeInitializationExceptionHResult=-2146233036Message=The type initializer for'Emgu.CV.CvInvoke' threw an exception.Source=Emgu.CV
       TypeName=Emgu.CV.CvInvokeStackTrace:
            at Emgu.CV.CvInvoke.CV_MAKETYPE(Int32 depth,Int32 cn)
            at Emgu.CV.OCR.Tesseract..cctor()in c:Emguemgucv-windows-universal-cuda 2.9.0.1922Emgu.CV.OCRTesseract.cs:line 26InnerException:System.DllNotFoundExceptionHResult=-2146233052Message=Unable to load DLL 'opencv_core290':The specified module could not be found.(Exceptionfrom HRESULT:0x8007007E)Source=Emgu.CV
            TypeName=""StackTrace:
                 at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler,IntPtr userdata,IntPtr prevUserdata)
                 at Emgu.CV.CvInvoke..cctor()in c:Emguemgucv-windows-universal-cuda 2.9.0.1922Emgu.CVPInvokeCvInvoke.cs:line 266

    This happens when trying to instantiate a new Tesseract object:

    var tesseract =newTesseract("","eng",Tesseract.OcrEngineMode.OEM_TESSERACT_CUBE_COMBINED);

    Since referencing "opencv_core290" does not work, I tried the workaround provided here. Basically, I copied the .dll to my project, added it by using "Add existing resource" and modified it's property to "Copy always". This did not work however. Thanks for any help!

    解决方法:

    I had this problem too. You should copy x86 and x64 folders from "yourEmguFolder/bin" to your project's output directory. Then build project again and run.

    I solved it according to the description on this page EMGU WIKI

  • 相关阅读:
    C++细节决定成败---菜鸡程序员被前辈蹂躏历程(持续更新)
    VIM杂记——基本使用
    UE4——用Android Studio打开UE4工程
    UE4——打包时遇到Could not determine java version from 'xx.x.x'的问题
    HTML笔记——常用标签总结
    LeetCode——142. Linked List Cycle II
    Leetcode——344. Reverse String
    UE4 隐藏虚拟摇杆
    UE4——实现走近物件其上方出现互动按钮并弹出UMG的功能
    UE4——调用API实现布娃娃死亡效果
  • 原文地址:https://www.cnblogs.com/zjoch/p/3550113.html
Copyright © 2011-2022 走看看