主要需要用到Capture类,VideoWriter,对象构造函数如下:
public Capture(int camIndex);----用于初始化摄像头。
public VideoWriter(string fileName, int fps, Size size, bool isColor);-----建立视频生产文件。
主要用到函数:
public virtual bool Retrieve(IOutputArray image, int channel = 0); //生成图像
public void Write(Mat frame); 写对象:
CvInvoke.PutText(tu1, DateTime.Now.ToString(), new Point(50, 50), Emgu.CV.CvEnum.FontFace.HersheyPlain, 1, new MCvScalar(0, 0, 255)); 写日期时间
实际效果:
重要代码如下:
如需定时更新,增加计时的功能,更改名字
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 Em