opencv学习笔记 读取avi视频

#include "cv.h"
int main( int argc, char** argv ) { 
    cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
    //CvCapture* capture = cvCaptureFromAVI( argv[1] ); // either one will work
    CvCapture* capture = cvCreateFileCapture( "test.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" );
}

你可能感兴趣的:(c,include,avi)