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

        分类:             Emgu CV              2012-11-28 17:22     927人阅读     评论(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

最新文章

  1. 玩玩redis
  2. 如何开启mysql计划事件
  3. sqlite使用小结
  4. Spring Batch Concepts Chapter
  5. RHCA442学习笔记-Unit13网络性能调整
  6. Linux和Windows下的进程管理总结
  7. max_connections 与 max_used_connections --ERROR 1040: Too many connections
  8. 如何给网页标题栏上添加图标(favicon.ico)
  9. HBase 4、Phoenix安装和Squirrel安装
  10. Java 集合 fail-fast机制 [ 转载 ]
  11. SQL查询根节点
  12. 为什么单片机中既有Flash又有EEPROM
  13. Chrome 插件PPAPI 开发(一)环境搭建
  14. 【转载】Qt之JSON生成与解析
  15. hibernate中多对多的注解配置
  16. Spring MVC controller 被执行两次
  17. LinkedBlockingQueue源码解析(2)
  18. CentOS 7下启动、关闭、重启、查看MySQL服务
  19. 一张图来帮你理解 SOA
  20. Linux下BLAST的使用---转载

热门文章

  1. CentOS查看CPU信息、位数、多核信息
  2. python参考手册--第10、11章执行环境、调试
  3. 玩玩EXPRESSJS
  4. &lt;算法竞赛入门经典&gt; 第8章 贪心+递归+分治总结
  5. IB_DESIGNABLE的使用
  6. Android TextView中的ellipsize属性
  7. java中遍历List中的map问题
  8. 致改变——总结&amp;规划(2016&#183;一)
  9. SharePoint 2010在win7 x64 安装
  10. 采用软件nginx实现web服务器集群