首页 > 其他 > 详细

Emgu cv3.0.0 图像收集

时间:2017-11-17 14:23:28      阅读:354      评论:0      收藏:0      [点我收藏+]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.Util;
using System.Threading;

namespace EmguTest1117_6
{
  public partial class Form1 : Form
  {
    private Capture capt;
    public Form1()
    {
      InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
      try
      {
        if (capt == null)
          capt = new Capture();
      }
      catch (NullReferenceException excpt)
      {
        MessageBox.Show(excpt.Message);
      }
      if (capt != null)
      {
        button1.Enabled = false;
        button2.Enabled = true;
        Application.Idle += new EventHandler(imageBox1_Click);
      }
    }

    private void button2_Click(object sender, EventArgs e)
    {
      if (capt != null)
      {
        button1.Enabled = true;
        button2.Enabled = false;
        Application.Idle -= new EventHandler(imageBox1_Click);
      }
    }

    private void Form1_Load(object sender, EventArgs e)
    {
      this.button1.Enabled = true;
      this.button2.Enabled = false;
    }

    private void imageBox1_Click(object sender, EventArgs e)
    {
      //Image<Bgr, Byte> frame = capt.QueryFrame();
      //Image<Bgr, Byte> frame = capt.QueryFrame();
      Mat mat = capt.QueryFrame();
      //imageBox1.Image = frame;
      imageBox1.Image = mat;
    }
  }
}

 

技术分享

技术分享

Emgu cv3.0.0 图像收集

原文:http://www.cnblogs.com/herd/p/7851089.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!