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

相关文章

原文地址:http://msdn.microsoft.com/en-us/magazine/cc163...
前言 随着近些年微服务的流行,有越来越多的开发者和团队所采...
最近因为比较忙,好久没有写博客了,这篇主要给大家分享一下...
在多核CPU在今天和不久的将来,计算机将拥有更多的内核,Mic...
c语言输入成绩怎么判断等级
字符型数据在内存中的存储形式是什么