C# opencv 加载图片报错

==========================

未经处理的异常:  System.TypeInitializationException: “Emgu.CV.CvInvoke”的类型初始值设定项引发异常。 ---> System.BadImageFormatException: 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)
   在 Emgu.CV.CvInvoke.RedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata)
   在 Emgu.CV.CvInvoke..cctor()
   --- 内部异常堆栈跟踪的结尾 ---
   在 Emgu.CV.CvInvoke.Imread(String filename, ImreadModes loadType)

===========================

原因:

CvInvoke.Imread 加载图片只能在debug 模式下;

原release 模式,修改为debug模式即可正常加载图片

猜你喜欢

转载自blog.csdn.net/zfjBIT/article/details/83094952