c# – ‘Emgu.CV.CvInvoke’的类型初始化器抛出异常

前端之家收集整理的这篇文章主要介绍了c# – ‘Emgu.CV.CvInvoke’的类型初始化器抛出异常前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我收到这个错误

The type initializer for ‘Emgu.CV.CvInvoke’ threw an exception.

当我尝试使用Emgu CV.我已经尝试了我能想到的一切,以解决这个问题,但它仍然提供相同的错误,当我点击它显示的按钮

Object reference not set to an instance of an object.

这是我正在尝试的代码

void ProcessFunction(object sender,EventArgs e)
{
    imgOrg = capturecam.QueryFrame();
    if (imgOrg == null) return;
    imgProc = imgOrg.InRange(new Bgr(50,50,50),new Bgr(255,255,255));
    imgProc = imgProc.SmoothGaussian(9);
    imageBox1.Image = imgOrg;
    imageBox2.Image = imgProc;
}

我可能做错了什么,如何进一步调试?谢谢!

解决方法

我有同样的问题.我的内在异常是“无法加载DLL”opencv_core290“”.

您需要将x86和x64文件夹从“yourEmguFolder / bin”复制到项目的输出(bin)目录.然后再次建立项目并运行.

根据emgu wiki

原文链接:https://www.f2er.com/csharp/94398.html

猜你在找的C#相关文章