错误:“ Emgu.CV.CvInvoke”的类型初始值设定项引发了异常 [英] Error:The type initializer for 'Emgu.CV.CvInvoke' threw an exception

查看:376
本文介绍了错误:“ Emgu.CV.CvInvoke”的类型初始值设定项引发了异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有以下代码:

I have this code in my project:

MCvFont font = new MCvFont(FONT.CV_FONT_HERSHEY_SCRIPT_SIMPLEX, 0.2d, 0.2d); 

程序运行时,它给出了一个例外:

When program runs, It gives an exception:


'Emgu.CV.CvInvoke'的类型初始值设定项引发了异常。

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.

所以请

推荐答案

通常,如果有某些错误,将抛出此类 Emgu.CV.CvInvoke异常您的Emgucv Dll的问题。

Usually these kind of "Emgu.CV.CvInvoke" exception will throw if there are some problems with your Emgucv Dll's.

检查以下几项:


  1. 打开您的项目&验证是否正确完成了所有项目->引用。例如Emgu.CV.UI.dll,Emgu.CV.dll,Emgu.CV.dll等。

  2. 检查复制到

  3. 如果您的操作系统是32位的,请确保仅链接32位的Dll。如果您使用的是64位操作系统,则复制相关的64位Dll。

  4. 将opencv_xxx.dll从您的opencv目录复制到Bin Dir。

  5. 最后检查Bin目录中是否存在所有dll。

  1. Open Your Project & Verify whether all the Project-> Reference's are made correctly.e.g Emgu.CV.UI.dll,Emgu.CV.dll,Emgu.CV.dll etc..
  2. Check the Copy to Local Check box is ticked or not.
  3. If your OS is 32-Bit then make sure you are linking only 32-Bit Dll's. If you are working with 64-Bit OS then copy relevant 64-Bit Dll's.
  4. Copy the opencv_xxx.dll's from your opencv directory to your Bin Dir.
  5. Finally Check all the dll's are present in the Bin directory or not.

现在编译&运行程序。

Now compile & run the program.

这篇关于错误:“ Emgu.CV.CvInvoke”的类型初始值设定项引发了异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆