写提莫的代码

导航

Emgu CV播放视频

public partial class Form1 : Form
{
    Capture _capture;
    public Form1()
    {
        InitializeComponent();
        _capture = new Capture(“url”);//视频文件路径
        _capture.ImageGrabbed += _capture_ImageGrabbed;//添加回调函数
        _capture.Start();
    }
 
    void _capture_ImageGrabbed(object sender, EventArgs e)
    {
        var frame = _capture.RetrieveBgrFrame();//frame为每一帧图像
              //处理图片
        pic.Image = frame.Bitmap;//返回每一帧图像(即播放)
              //针对frame做其他处理
              ......
    }
}

posted on 2015-09-16 15:13  写提莫的代码  阅读(625)  评论(0编辑  收藏  举报