其实这个程序就是把图片一帧一帧的播放,时间间隔由cvwaitkey确定为33ms
#include "highgui.h"
int main()
{
CvCapture* capture=cvCreateFileCapture("a.avi");//cvcapture为AVI的基本结构属性信息的结构体指针,cvcreatfilecapture为加载相关视频文件到内存的函数
IplImage* frame;//frame为中间图片型指针变量
cvNamedWindow("showing");
while(1)
{
frame=cvQueryFrame(capture);//cvqueryframe 作用为返回当前帧图片的指针并更新capture指向下一帧
cvShowImage("showing",frame);
cvWaitKey(33);
}
}