EmguCV TypeInitializationException [英] EmguCV TypeInitializationException
问题描述
我真的EgmuCV一个新手
i really a newbie with EgmuCV
我试图捕捉摄像头的图像有以下code:
i try to capture images from webcam with the following code:
//Program.cs (Winform)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.UI;
using Emgu.Util;
using Emgu.CV.Structure;
namespace EgmuCVTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Capture cp = new Capture();
ImageViewer imv = new ImageViewer();
Application.Idle += new EventHandler(delegate(object s, EventArgs ea)
{
imv.Image = cp.QueryFrame();
});
imv.ShowDialog();
}
}
}
我得到后续的错误:
i get the follow error:
我检查,并在该.exe文件夹中所有的dll necesary
i check and have all necesary dll in the .exe folder
推荐答案
遇到同样的问题了一段时间后,我发现的说明解决这个(<一个href=\"http://www.emgu.com/wiki/index.php/Download_And_Installation#The_type_initializer_for_.27Emgu.CV.CvInvoke.27_threw_an_exception.\">TypeInitializer异常)是不完整的。
After experiencing this same problem for a while, I found the instructions for solving this (TypeInitializer Exception) are incomplete.
-
对于基本的应用程序,你需要
cvextern.dll,Emgu.CV.dll,Emgu.CV.UI.dll,Emgu.Util.dll
中该.EXE目录。
您需要的x86(64位)的.exe文件目录和里面的86DIR需要DIR opencv_calib3dXXX.dll,opencv_contribXXX.dll,opencv_coreXXX.dll,opencv_features2dXXX.dll,opencv_highguiXXX .dll文件,opencv_imgprocXXX.dll,opencv_legacyXXX.dll,opencv_mlXXX.dll,opencv_objectdetectXXX.dll,opencv_videoXXX.dll
和 cudart32_42_9.dll,npp32_42_9.dll,opencv_flann240.dll
You need a x86(x64) dir in the .exe directory and inside "x86" dir you need opencv_calib3dXXX.dll, opencv_contribXXX.dll, opencv_coreXXX.dll, opencv_features2dXXX.dll, opencv_highguiXXX.dll, opencv_imgprocXXX.dll, opencv_legacyXXX.dll, opencv_mlXXX.dll, opencv_objectdetectXXX.dll, opencv_videoXXX.dll
and cudart32_42_9.dll, npp32_42_9.dll, opencv_flann240.dll
该应用程序将只要您包含所有必需的dll的工作。
The app will work as soon as you include all of the required DLLs.
这篇关于EmguCV TypeInitializationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!