使用emgucv读取USB相机图像

来源:互联网 发布:upchina是什么软件 编辑:程序博客网 时间:2024/05/24 23:15
 public partial class Form1 : Form
{

        private Capture cap = null;
        public Form1()
        {
            InitializeComponent();
            cap = new Capture(0);
            Application.Idle+=new EventHandler(Application_Idle);
        }
      private void Application_Idle(object sender, EventArgs e)
        {
            Mat frame = new Mat();
            frame = cap.QueryFrame();
            Image<Bgr, Byte> fram = frame.ToImage<Bgr, Byte>(); 
            picRaw.Image = fram.ToBitmap();
        

        }

}