0

こんにちは、カンペラ キャプチャ アプリケーションを開発しています。現在、EmguCV 2.0 を使用しています。次のコード行でエラーが発生します。


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


Emgu.CV、Emgu.CV.UI、Emgu.CV.ML、Emgu.Util などの EmguCV の必要な参照をすべて追加しましたが、それでも次のようなエラーが表示されます。

エラー 1 名前'キャプチャ'は現在のコンテキストに存在しません C:\Documents and Settings\TLNA\my documents\visual studio 2010\Projects\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);
        }

       

        
    }
    }
4

1 に答える 1

0

キャプチャ用の変数を宣言するのを忘れたようです。

編集: 自分で emgu を使用したことがないため、あまり役に立ちませんが、Google で数分、キャプチャの設定に役立つ可能性のあるhttp://www.emgu.com/wiki/index.php/Tutorial#Examplesに出くわしました。適切にオブジェクト。

于 2010-06-12T06:01:29.343 に答える