OpenCV视频读取

#include "highgui.h"

int main()

{

//视频的读取
cvNamedWindow("Example2",CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("G:\\
....avi");
IplImage * frame;
while (1)
{
frame = cvQueryFrame(capture);
if (!frame)
{
break;
}
cvShowImage("Example2",frame);
char c = cvWaitKey(33);
if (c == 27)
{
break;
}
}
cvReleaseCapture(&capture);
cvDestroyWindow("Example2");


return 0;

}

你可能感兴趣的:(OpenCV视频读取)