Created
February 3, 2018 19:23
-
-
Save luizventurote/9b20aa1006a75cec5f1c7fe1635e3afe to your computer and use it in GitHub Desktop.
OpenCV load a video.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
#include "opencv2/highgui/highgui.hpp" | |
int main( int argc, const char** argv ) { | |
cvNamedWindow("Example2", CV_WINDOW_AUTOSIZE); | |
CvCapture* capture = cvCreateFileCapture( argv[1] ); | |
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"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment