Video Load

Feb 28, 2011 by admin    No Comments    Posted under: Programming

Example

Load a video from the “Videos” directory

/*
 *      Author: Dimitrios Prodromou
 *      office@robotas.at
 */
 
// opencv includes
#include <opencv/cv.h> /* required to use OpenCV */
#include <opencv/highgui.h> /* required to use OpenCV's highgui */
 
int main(int argc, char** argv)
{
 
 cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
 CvCapture* capture = cvCreateFileCapture( "Videos/girl_walk.mp4" );
 IplImage* frame;
 while(1) {
 frame = cvQueryFrame( capture );
 cvShowImage( "Example2", frame );
 char c = cvWaitKey(33);
 if( c == 27 ) break;
 }
 cvReleaseCapture( &capture );
 cvDestroyWindow( "Example2" );
 
return 0;
}

Got anything to say? Go ahead and leave a comment!

You must be logged in to post a comment.