开发者

The name capture does not exist in the current context ERROR

Hi I am developing a campera capture application. I am currently using EmguCV 2.0. I get an error with the following line of code :


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


I have added all the required references of EmguCV like Emgu.CV,Emgu.CV.UI, Emgu.CV.ML, Emgu.Util, but still it gives a error saying :

Error 1 The name 'capture' does not exist in the current context C:\Documents and Settings\TLNA\my documents\visual studio 2010\Projects\webcamcapture\webcamcapture\Form1.cs 27 38 webcamcapture


I got this code from here. The full program code is given below:-


    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;

    u开发者_如何转开发sing 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);
        }

       

        
    }
    }


Looks like you forgot to declare a variable for capture.

Edit: never having used emgu myself, i cant help much, but a couple mins on google and i stumbled across http://www.emgu.com/wiki/index.php/Tutorial#Examples which might help you set up the capture object properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜