Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

g++ p.cpp -o p `pkg-config --cflags --libs opencv`

#include <stdio.h>

#include <opencv/cv.h>

#include <opencv/highgui.h>

#include <math.h>

#include <iostream>

using namespace cv;

using namespace std;

int main(int argc, char* argv[]) {

VideoCapture cap("test.avi"); // open the video file for reading

IplImage* img =0;

cvNamedWindow("a",CV_WINDOW_AUTOSIZE);

while(1){

    Mat frame;

// img = cvQueryFrame(frame);

bool img = cap.read(frame); if(!img) break;

imshow("a",frame);

cvWaitKey(44);

}

cvWaitKey(0);

return 0;

}