Ошибка в C# "инициализатор типа для' emgu.cv.cvinvoke' вызвал исключение."
Ошибка кода, пожалуйста, помогите мне!!!
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.CvEnum; using Emgu.CV.Structure; using Emgu.CV.UI; namespace WindowsFormsApplication3 { public partial class Form1 : Form { Capture capturecam = null; //instance for capture using webcam bool CapturingProcess = false; //boolean stating the capturing process status Image<Bgr, Byte> imgOrg; //image type RGB (or Bgr as we say in Open CV) Image<Gray, Byte> imgProc; //processed image will be grayscale so a gray image public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { try { capturecam = new Capture(); } catch (NullReferenceException exception) { MessageBox.Show(exception.Message); return; } Application.Idle += new EventHandler(ProcessFunction); CapturingProcess = true; } 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); original.Image=imgOrg; processed.Image=imgProc; } private void playorpause_Click(object sender, EventArgs e) { if (CapturingProcess == true) { Application.Idle -= ProcessFunction; CapturingProcess = false; playorpause.Text= "Play"; } else { Application.Idle += ProcessFunction; CapturingProcess = true; playorpause.Text= "Pause"; } } } }
Что я уже пробовал:
После отладки возникает ошибка:
"The type initializer for 'Emgu.CV.CvInvoke' threw an exception.".