2012-02-04 7 views
5

を投げたためタイプ初期化子:「Emgu.CV.CvInvokeは、」私はEmguCVを使用してC#でVS 2010で画像やショーの画像を開くには、簡単なプログラムを書かれているが、私は次の例外を取得しています例外

'Emgu.CV.CvInvoke'の型初期化子が例外をスローしました。ここでラインImage<Bgr, Byte> myimg = new Image<Bgr, Byte>(openfile.FileName);

は私のコード..です

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.Util; 
using Emgu.CV.Structure; 

namespace imgdisplay2 
{ 
    public partial class Form1 : Form 
    { 
     public Form1() 
     { 
      InitializeComponent(); 
     } 

     private void imageBox1_Click(object sender, EventArgs e) 
     { 
     } 

     private void button1_Click(object sender, EventArgs e) 
     { 
      OpenFileDialog openfile = new OpenFileDialog(); 
      if (openfile.ShowDialog() == DialogResult.OK) 
      { 
       // imageBox1 =new Emgu.CV.UI.ImageBox() ; 
       Image<Bgr, Byte> myimg = new Image<Bgr, Byte>(openfile.FileName); 
       pictureBox1.Image = myimg.ToBitmap(); 
       //imageBox1.Image =myimg ; 
      } 
     } 

     private void pictureBox1_Click(object sender, EventArgs e) 
     { 
     } 
    } 
} 
+0

例外上の任意の詳細? – Bort

+1

ポストのInnerException、それは数える一つです。 –

答えて

1

ここで問題を解決する方法は次のとおりです。 Emguがインストールされている "bin"フォルダ内のx86(または64ビットOS上のx64)フォルダアドレスをコピーします。 C:\ Emgu \ emgucv-windows-universal-gpu 2.4.9.1847 \ bin \ x86

コントロールパネル>システム>高度なシステム設定>環境変数>システム変数でこのアドレスを貼り付けてください。 「パス」と> [編集]をクリックしますが、文字列の末尾にセミコロンを追加して、あなただけではセミコロンの後にクリップボードにコピーしたアドレスを貼り付け> OKSをクリックしてください。

関連する問題