I\'m getting this error
The type initializer for \'Emgu.CV.CvInvoke\' threw an exception.
when I try to use Emgu CV. I\'ve tried
you could using LD_LIBRARY_PATH
to solve it:
open the warning and check what lib your program lack
locate the path
$ locate # to find the library path
In your IDE, set the environment variable LD_LIBRARY_PATH
to the lib path,(I use monodevelop, the path is Run-->Run With-->Custom Parameters...)
it work quit good now :)
Found this on c#,VS 2017, emgu version 3.2.0.2682
Tried a simple build on AnyCPU and received the bad format exception. So I tried x86 bad format exception because of possible suggestions in the comments. Finally I put it as x64 and it worked fine.
Copy and paste all the unmanaged dlls in the bin folder of your EMGU installation to where your exe file is (Release or Debug folder of your project folder).
In my case, unmanaged dlls are at "C:\Emgu\emgucv-windows-universal-cuda 2.9.0.1922\bin\x86"
I Had the same problem in my 32 bit machine for 3 days. I resolved this by simply copying all dlls into system32 folder from the bin and x86 folders and it worked. It looks like there are dlls that depend on other dlls and the moment you transfer all it works. I did not have time to find out which one.
For me problem was solved by clicking in Visual Studio:
Menu -> Project -> Properties -> Build -> Prefer 32-bit.
It must have been a problem with emgu (probably x86) and my OS x64).