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.CvEnum;
using Emgu.CV.Structure;
using Emgu.CV.UI;
namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
ImageViewer viewer = new ImageViewer(); //create an image viewer
VideoCapture capture = new VideoCapture(); //create a camera captue
Application.Idle += new EventHandler(delegate (object sender1, EventArgs e1)
{ //run this until application closed (close button click on image viewer)
viewer.Image = capture.QueryFrame(); //draw the image obtained from camera
pictureBox1.Image = viewer.Image.Bitmap;
});
//viewer.ShowDialog(); //show the image viewer
//pictureBox1.Image = viewer.Image.Bitmap;
}
}
}
EMGU 三 打开摄像头
最新推荐文章于 2024-07-19 09:41:49 发布