#include "cv.h"
#include "highgui.h"
using namespace cv;
using namespace std;
int main()
{
//读取图像
IplImage* pFrame;
CvCapture* pCapture=NULL;
pCapture=cvCaptureFromFile("walk.avi");
int nFrmNum=0;
cvNamedWindow("test",CV_WINDOW_AUTOSIZE);
while(pFrame=cvQueryFrame(pCapture))
{
nFrmNum++;
cvShowImage("test",pFrame);
cvWaitKey(33);
}
//cvDestroyWindow("test");
//cvReleaseImage(&pFrame);
//cvReleaseCapture(&pCapture);
waitKey(0);
return 0;
}
#include "cv.h"
#include "highgui.h"
using namespace cv;
using namespace std;
int main()
{
//读取图像
Mat frame;
VideoCapture capture("walk.avi");
if(!capture.isOpened())
return -1;
int totalFrmNum=capture.get(CV_CAP_PROP_FRAME_COUNT);
int deley=1000/capture.get(CV_CAP_PROP_FPS);
while(capture.read(frame))
{
char c=waitKey(deley);
if(c==27)
break;
capture.read(frame);
imshow("test",frame);
}
waitKey(0);
return 0;
}