日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Windows7 64位机上Emgu CV2.4.2安装与配置

發布時間:2023/11/27 生活经验 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Windows7 64位机上Emgu CV2.4.2安装与配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.????? 從http://sourceforge.net/projects/emgucv/?source=directory下載最新的Emgu CV2.4.2;

2.????? 將libemgucv-windows-x86-gpu-2.4.2.1777拷貝到D:\soft\Emgu2.4.2文件夾下,運行此.exe文件,將其安裝到D:\soft\Emgu2.4.2\emgucv-windows-x86-gpu2.4.2.1777文件夾下,安裝完后會自動重啟;

3.????? 將D:\soft\Emgu2.4.2\emgucv-windows-x86-gpu2.4.2.1777\bin;D:\soft\Emgu2.4.2\emgucv-windows-x86-gpu2.4.2.1777\bin\x86(此x86文件夾下包含有對應的OpenCV2.4.2的動態庫,將此目錄加入到環境變量后Emgu不需要額外的安裝相對應的OpenCV);添加到系統環境變量Path中,重啟;

4.????? 打開vs2008,新建一個基于Windows窗體的應用程序;

5.????? 導入UI插件:Tool-->Choose Toolbox Items-->.NET Framework Components-->點擊Browse,選中D:\soft\Emgu2.4.2\emgucv-windows-x86-gpu2.4.2.1777\bin下的Emgu.CV.UI.dll打開,會在列表中新增HistogramBox、ImageBox、MatrixBox、PanAndZoomPictureBox四項;

6.????? 添加引用:選中工程下的References-->Add Reference-->Browse選中D:\soft\Emgu2.4.2\emgucv-windows-x86-gpu2.4.2.1777\bin下的Emgu.CV.dll、Emgu.CV.ML.dll、 Emgu.CV.UI.dll、 Emgu.Util.dll、ZedGraph.dll 5個動態庫,點擊OK;

7.????? 點擊Solution Platforms-->Configuration Manager:Active solution platform將原來的Any CPU改為x86,否則會提示“Emgu.CV.CvInvoke的類型初始值設定項引發異常”的錯誤。

?

網上的一個代碼示例,編譯、運行成功:

?

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

?

usingEmgu.CV;//Emgu

usingEmgu.CV.Structure;

usingEmgu.Util;

usingSystem.Threading;

?

namespaceTestEmgu

{

??? public partial class Form1 : Form

??? {

???????public Form1()

???????{

???????????InitializeComponent();

???????}

?

???????privateCapturecapture;

???????privateboolcaptureinprocess;//判斷攝像頭的狀態

?

???????privatevoidbutton1_Click(objectsender, EventArgse)

???????{

???????????if(capture !=null)

???????????{

???????????????if(captureinprocess)

???????????????{

???????????????????Application.Idle -=new EventHandler(processframe);

?

???????????????????button1.Text ="stop!";

???????????????}

???????????????else

???????????????{

???????????????????Application.Idle +=new EventHandler(processframe);

?

???????????????????button1.Text ="start!";

???????????????}

?

???????????????captureinprocess= !captureinprocess;

???????????}

???????????else//攝像頭為空,則通過Capture()方法調用

???????????{

???????????????try

???????????????{

???????????????????capture= newCapture();

???????????????}

???????????????catch(NullReferenceExceptionexcpt)

???????????????{

???????????????????MessageBox.Show(excpt.Message);

???????????????}

???????????}

???????}

?

???????privatevoidprocessframe(objectsender, EventArgsarg)

???????{

???????????Image<Bgr,Byte> frame =capture.QueryFrame();

?

???????????imageBox1.Image =frame;

???????}

??? }

}

?

參考文獻:

1.? http://www.emgu.com/wiki/

2.? http://blog.163.com/woshitony111@126/blog/static/71379539201282511180304/

3.? http://blog.csdn.net/gaaranaruto/article/details/6328358

總結

以上是生活随笔為你收集整理的Windows7 64位机上Emgu CV2.4.2安装与配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

歡迎分享!

轉載請說明來源于"生活随笔",并保留原作者的名字。

本文地址:Windows7 64位机上Emgu CV2.4.2安装与配