您的位置:首页 > 运维架构

OpenCv学习笔记(五):使用VideoCapture类函数实现视频的播放

2012-06-10 20:54 363 查看
opencv早就实现了对视频的处理,需要指出的是opencv对视频的处理比matlab实现视频处理不知要快了多少倍。为了交流学习,我都把代码写的特别短,就不做详细解释了。需要说明的是VideoCapture函数:

#include "stdafx.h"

#include "opencv2/imgproc/imgproc.hpp"

#include "opencv2/highgui/highgui.hpp"

#include <iostream>

#include <vector>

using namespace cv;

int main( int argc, char** argv )

{

Mat frame;

cvNamedWindow("myVideoPlayer");

VideoCapture cp("d:/Bucket_list.avi");

while(1)

{

cp>>frame;

imshow("myVideoPlayer",frame);

waitKey(30);

}

waitKey(0);

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: