// opencv2001.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "cxcore.h"
#include "highgui.h"
#include "cvaux.h"
#include "string.h"
#include "stdio.h"
#include "time.h"
#include <iostream>
#include <vector>
using namespace std;
using namespace cv;
#pragma comment (lib,"cv210d.lib")
#pragma comment (lib,"highgui210d.lib")
#pragma comment (lib,"cvaux210d.lib")
int main( )
{
//CvCapture * capture = cvCaptureFromAVI ("video1.avi"); //读取视频
CvCapture *capture =cvCreateFileCapture("Video1.avi");
if(capture==NULL) {
printf("NO capture"); //读取不成功,则标识
// return 1;
};
cvNamedWindow("example",CV_WINDOW_AUTOSIZE); //定义窗口
IplImage * frame1;
while(1){
frame1 = cvQueryFrame( capture ); //抓取帧
if(!frame1)break;
cvShowImage("example",frame1); //显示
//cvReleaseImage(&frame1);
char c=cvWaitKey(33);
if (c==27)
{
break;
}
}
cvReleaseCapture(&capture);
cv::waitKey(0);
return 0;
}