Failed to load DLL 'opencv_core242': the specified module was not found. Emgu cv

I am trying to start using CV CV CV CV for C #. But I have problems with work. I follow this guide to make a simple program using emgu CV Link , but I get the following error: (any idea what am I doing wrong?)

System.TypeInitializationException was unhandled Message=The type initializer for 'Emgu.CV.CvInvoke' threw an exception. Source=Emgu.CV TypeName=Emgu.CV.CvInvoke StackTrace: at Emgu.CV.Image`2..ctor(String fileName) in c:\Emgu\emgucv-windows-x86-gpu 2.4.2.1777\Emgu.CV\Image.cs:line 144 at TEST.Form1.button1_Click(Object sender, EventArgs e) in c:\documents and settings\laci\my documents\visual studio 2010\Projects\TEST\TEST\Form1.cs:line 28 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at TEST.Program.Main() in c:\documents and settings\laci\my documents\visual studio 2010\Projects\TEST\TEST\Program.cs:line 18 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.DllNotFoundException Message=Unable to load DLL 'opencv_core242': The specified module could not be found. (Exception from 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:\Emgu\emgucv-windows-x86-gpu 2.4.2.1777\Emgu.CV\PInvoke\CvInvoke.cs:line 166 InnerException: 
+6
source share
6 answers

Since Emgu.CV is just a .NET shell (see http://en.wikipedia.org/wiki/Wrapper_library ), you need to put your own .DLL files from OpenCV in the output directory of your application.

You can find the necessary files by downloading the corresponding version of OpenCV at http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.2/OpenCV-2.4.2.exe/download

+8
source

I will save you a lot of time. for version EMGU CV 2.4. * The missing dll is "nvcuda.dll", which is not part of the EMGU binaries, but is usually located in the system32 folder (you may need to install the nvidia driver if you are not just looking for the dll online)

+3
source

You can solve this problem using Dependency Walker → http://www.dependencywalker.com/ on "opencv_core242.dll" to find the missing DLL.

It seems to me that I do not have tbb.dll as Thread is not found here tbb.dll

Just download from https://www.threadingbuildingblocks.org/ and copy the tbb * .dll file to the working directory or "System32", this will be fine

+1
source

Old, but I had the same problem. It turns out that 2.4.0 has integration with the GPU, and if you do not have an Nvidia card, nvcuda.dll is missing and the opencv_core242.dll file does not load. I tried everything, the only solution was to return to 2.3.0, and everything worked fine.

+1
source

Just like the error indicates: it cannot find the native DLL in the working directory of your application. Make sure the opencv_core242.dll library is copied to the output directory and working directory of your application.

0
source

Download the dependency host from http://www.dependencywalker.com/ and open the .dll, requiring it not to load. Then find the dependencies, if one or more of them are missing in the application directory even of your system folder (system32 or syswow64), then they should be there.

0
source

All Articles