#include "cv.h" #include "cxcore.h" #include "highgui.h" int main(int argc, char* argv[]) { IplImage *frame; int key = 'a'; /* load the AVI file */ CvCapture *capture = cvCaptureFromAVI("Video.avi"); /* always check */ if( !capture ) return 1; /* get fps, needed to set the delay */ int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS ); /* display video */ cvNamedWindow( "video", CV_WINDOW_AUTOSIZE ); while( key != 'q' ) { /* get a frame */ frame = cvQueryFrame( capture ); /* always check */ if( !frame ) break; /* display frame */ cvShowImage( "video", frame ); /* quit if user press 'q' */ cvWaitKey( 1000 / fps ); } /* free memory */ cvReleaseCapture( &capture ); cvDestroyWindow( "video" ); return 0; }
Wednesday, May 4, 2011
Episode_5_Working_with_Video
After working with camera Now we will play with video. Video ??? Of course, we can play video and capture the image with OpenCV. The Video should be in AVI files and you must put your video file into your project. Ok let's try it
Labels:
Episode 5 : Working_with_Video
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment