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

落花浮王杯 提交于 2019-12-25 11:06:08

问题


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:

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

So please help me with on this issue.


回答1:


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

Check these following thing's:

  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.



来源:https://stackoverflow.com/questions/24299467/errorthe-type-initializer-for-emgu-cv-cvinvoke-threw-an-exception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!