Unable to capture .avi video frames (Visual studio 2010)

asked 2013-12-13 04:11:05 -0500

I am a beginner. Following code running well in VS-2010 but the video frames are not displayed in window. when I am displaying image it was ok.

#include "opencv\highgui.h"

    using namespace cv;

     int main( int argc, char** argv )
     {
     cvNamedWindow("bus", CV_WINDOW_AUTOSIZE);
     CvCapture* capture=cvCreateFileCapture("bus_cif.avi");
     IplImage* frame;
     while (1)
     {
     frame= cvQueryFrame ( capture );
     if (!frame) break;
     cvShowImage ("bus", frame);
     char c=cvWaitKey(33);
     if (c ==27) break;
     }

     cvReleaseCapture(&capture);
     cvDestroyWindow("bus");
 }
edit retag flag offensive close merge delete