Emgu.CV使用时出现报错,DllNotFoundException: Unable to load DLL 'cvextern' or one of its dependencies: 找不到指定的模块
程序报错具体内容
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
Source=Emgu.CV
StackTrace:
在 Emgu.CV.CvInvoke.Imread(String filename, ImreadModes loadType)
在 Program.Main(String[] args) 在 D:\xxx\xxx\Program.cs 中: 第 17 行
此异常最初是在此调用堆栈中引发的:
Emgu.CV.CvInvoke.CvInvoke()
内部异常 1:
DllNotFoundException: Unable to load DLL 'cvextern' or one of its dependencies: 找不到指定的模块。 (0x8007007E)
原因以及解决办法
原因可能很简单,就是VS中没有正确安装Emgu。
参考Emgu的官方文档,需要安装Emgu.CV.runtime.windows,而不是只安装Emgu.CV。
参考:
https://emgu.com