C#下的openCV(Emgu CV)
2011-04-16 20:58
447 查看
Emgu CV下载地址
http://sourceforge.net/projects/emgucv/files/
找最新的下就行了,傻瓜式安装,选择目录后自动完成安装,然后提示安装VS2008和VS2010的插件,我使用的是VS2010,然后完成操作。
Emgu CV是什么?
Emgu CV是.NET平台下对OpenCV图像处理库的封装,也就是.NET版。可以运行在C#、VB、VC++等。
安装完成后需要设置环境变量,比如我安装在E:/Emgu/emgucv-windows-x86 2.2.1.1150,然后再系统环境变量添加E:/Emgu/emgucv-windows-x86 2.2.1.1150/bin即可
编写第一个小程序
在VS2010中新建一个Windows应用程序
首先需要导入UI插件
在浏览中定位到Emgu的安装目录bin下,选择Emgu.CV.UI.dll
在引用中添加dll调用,分别是Emgu.CV.dll和Emgu.CV.ML.dll和Emgu.CV.UI.dll和Emgu.Util.dll以及ZedGraph.dll
添加完毕后放置一个Button控件和一个imagebox控件(第三张图中导入的自定义插件),然后编写代码即可
代码
总结
我刚开始研究Emgu CV,有很多很多不懂的地方,以上步骤我基本是按照网上教程一步一步做的(http://www.dotblogs.com.tw/chou/archive/2009/06/13/8812.aspx),没有任何问题,CV中提供了众多的借口方便调用,非常适合需要图像处理而不精通算法的人,这里面非常值得研究,这是我发的第一篇心得,基本算是转帖,大家见谅!欢迎一起讨论
http://sourceforge.net/projects/emgucv/files/
找最新的下就行了,傻瓜式安装,选择目录后自动完成安装,然后提示安装VS2008和VS2010的插件,我使用的是VS2010,然后完成操作。
Emgu CV是什么?
Emgu CV是.NET平台下对OpenCV图像处理库的封装,也就是.NET版。可以运行在C#、VB、VC++等。
安装完成后需要设置环境变量,比如我安装在E:/Emgu/emgucv-windows-x86 2.2.1.1150,然后再系统环境变量添加E:/Emgu/emgucv-windows-x86 2.2.1.1150/bin即可
编写第一个小程序
在VS2010中新建一个Windows应用程序
首先需要导入UI插件
在浏览中定位到Emgu的安装目录bin下,选择Emgu.CV.UI.dll
在引用中添加dll调用,分别是Emgu.CV.dll和Emgu.CV.ML.dll和Emgu.CV.UI.dll和Emgu.Util.dll以及ZedGraph.dll
添加完毕后放置一个Button控件和一个imagebox控件(第三张图中导入的自定义插件),然后编写代码即可
代码
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;//PS:调用的Emgu dll using Emgu.CV.Structure; using Emgu.Util; using System.Threading; namespace Emgu1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private Capture capture; private bool captureinprocess;//判断摄像头的状态 private void button1_Click(object sender, EventArgs e) { if (capture != null)//摄像头不为空 { if (captureinprocess) { Application.Idle -= new EventHandler(processfram); button1.Text = "Stop!"; } else { Application.Idle += new EventHandler(processfram); button1.Text = "Start!"; } captureinprocess = !captureinprocess; } else//摄像头为空则通过Capture()方法调用 { try { capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } } private void processfram(object sender, EventArgs arg) { Image<Bgr, Byte> frame = capture.QueryFrame(); imageBox1.Image = frame; } } }
总结
我刚开始研究Emgu CV,有很多很多不懂的地方,以上步骤我基本是按照网上教程一步一步做的(http://www.dotblogs.com.tw/chou/archive/2009/06/13/8812.aspx),没有任何问题,CV中提供了众多的借口方便调用,非常适合需要图像处理而不精通算法的人,这里面非常值得研究,这是我发的第一篇心得,基本算是转帖,大家见谅!欢迎一起讨论
相关文章推荐
- VS2010、C#、Emgu CV配置 ; 在C#下使用OpenCV ; C#中使用OpenCV(Emgu CV); 配置全程截图
- VS2010、C#、Emgu CV配置 ; 在C#下使用OpenCV ; C#中使用OpenCV(Emgu CV)
- C#中使用OpenCV(Emgu CV)
- Emgu.CV,OpenCV for C#
- VS2008 C# OpenCV “Emgu.CV.CvInvoke”的类型初始值设定项引发异常。
- C#下的openCV(Emgu CV)
- C#调用OpenCV(一) 配置VS+OpenCV+Emgu cv
- Emgu CV(OpenCV for C#)学习笔记(2)
- C#下使用openCV(Emgu CV)
- VS2010、C#、Emgu CV配置 ; 在C#下使用OpenCV ; C#中使用OpenCV(Emgu CV); 配置全程截图
- VS2010、C#、Emgu CV配置 ; 在C#下使用OpenCV ; C#中使用OpenCV(Emgu CV); 配置全程截图,不能请留言!
- C#下的openCV(Emgu CV)
- 【C# -- OpenCV】Emgu CV 第一个实例
- 【C# -- OpenCV】Emgu CV 第一个实例
- C#下的openCV(Emgu CV)
- C#+Emgucv:解决"Emgu.CV.CvInvoke”的类型初始值设定项引发异常"的问题
- C#“Emgu.CV.CvInvoke”的类型初始值设定项引发异常
- C#调用 opencv cv::Mat 图像
- 利用Emgu.CV实现人脸识别详解 (C#)--附源码
- C#“Emgu.CV.CvInvoke”的类型初始值设定项引发异常