2010-06-12 139 views
0

嗨,我正在开发一个campera捕获应用程序。我目前正在使用EmguCV 2.0。我获得与下面的行的代码中的错误:在当前上下文中不存在名称捕获错误


图片图像= 捕获 .QueryFrame();


我已经加入EmguCV像Emgu.CV,Emgu.CV.UI,Emgu.CV.ML,Emgu.Util所要求的所有引用,但仍然给人一种错误说:

错误1名'捕捉'没有在当前的背景下存在C:\ Documents和Settings \ TLNA \我的文档\ Visual Studio 2010的\项目\ webcamcapture \ webcamcapture \ Form1.cs中27 38 webcamcapture


我从here得到了这段代码。完整的程序代码如下: -


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.CV.UI; 

using Emgu.CV.Structure; 

using Emgu.CV.ML; 



namespace webcamcapture 
{ 
public partial class Form1 : Form 
{ 


    public Form1() 
    { 
     InitializeComponent(); 
    } 

    private void timer1_Tick(object sender, EventArgs e) 
    { 
     Image<Bgr, Byte> image = capture.QueryFrame(); 

     pictureBox1.Image = image.ToBitmap(pictureBox1.Width, pictureBox1.Height); 
    } 




} 
} 

回答

0

您似乎忘记声明一个变量捕获。

编辑:从来没有使用emgu我自己,我不能帮上忙,但几分钟谷歌和我偶然发现http://www.emgu.com/wiki/index.php/Tutorial#Examples这可能会帮助您正确设置捕获对象。

+0

是否像Capture s = new Capture(); – Haxed 2010-06-12 06:13:56

+0

好吧,我试过这个Capture capture = new Emgu.CV.Capture();但我得到一个空白表格。 – Haxed 2010-06-12 06:16:12

+0

thk mate它的工作 – Haxed 2010-06-12 06:25:41

相关问题