|
|
2010/1/22 下午 10:18:24
之前參考過 "如何在VC#2008上用OpenCV拍照" 的文章 我試著照做一次文章所說的內容 編譯沒有問題 但是在執行的時候 按下button那一刻 卻發生
"類型 'System.TypeInitializationException' 的未處理例外狀況發生於 Emgu.CV.dll 其他資訊: 'Emgu.CV.CvInvoke' 的型別初始設定式發生例外狀況。"
我下載小歐大的範例 也出現同樣的問題 請求高手幫忙解答
以下是我的程式碼 using Emgu.CV; using Emgu.CV.Structure; using Emgu.Util; using System.Threading;
namespace MyOpenCV { public partial class Form1 : Form { public Form1(){省略}
private Capture _capture; private bool _captureInProgress;
private void ProcessFrame(object sender, EventArgs arg) { Image<Bgr, Byte> frame = _capture.QueryFrame(); captureImageBox.Image = frame; }
private void captureButton_Click(object sender, EventArgs e) { #region if capture is not created, create it now if (_capture == null) { try { _capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion
if (_capture != null) { if (_captureInProgress) { //stop the capture Application.Idle -= new EventHandler(ProcessFrame); captureButton.Text = "Start Capture"; } else { //start the capture captureButton.Text = "Stop"; Application.Idle += new EventHandler(ProcessFrame); }
_captureInProgress = !_captureInProgress; } }
} }
|
|
|
|
2010/1/23 上午 12:40:57
我用的環境是opencv2.0 emgu也是適用於2.0的版本
官方網站上寫說 Copy the OpenCV dll files: cvXXX.dll, cvauxXXX.dll, cxcoreXXX.dll, highguiXXX.dll, opencv_ffmpegXXX.dll, mlXXX.dll and cvextern.dll to the execution directory, where XXX is the OpenCV version number.
我有放OpenCV中的bin裡的相對應檔案 但2.0的檔名都已經變成libXXXXdll 不知道有沒有影響?
官網說的這個 "MSVCRT" 我也有裝了 還是不知道問題在哪裡....
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
板主 :
小朱
Top 10 評價排行 |
 |
C# |
|
|
|
|
|
|
|
|
|
|
|
|
|
| C# |
 |
|
| |
專家等級 |
評價 |
|
| |
一代宗師 |
10000 |
|
| |
曠世奇才 |
5000 |
|
| |
頂尖高手 |
3000 |
|
| |
卓越專家 |
1500 |
|
| |
優秀好手 |
750 |
|
|
|
|
|
|
|
|
|
|
|
|
Microsoft Internet Explorer
6.0. Screen 1024x768 pixel. High Color (16 bit).
2000-2013 程式設計俱樂部 http://www.programmer-club.com.tw/ |
|
|