Mercurial Hosting > traffic-intelligence
view c/optical-flow.cpp @ 11:e77e2fd69b02
modularized code (not compiling)
author | Nicolas Saunier <nico@confins.net> |
---|---|
date | Wed, 11 Nov 2009 12:01:43 -0500 |
parents | 068cf45c3f1b |
children | ff5403319cec |
line wrap: on
line source
#include "cvutils.hpp" #include "opencv/cv.h" #include "opencv/highgui.h" #include <iostream> #include <ctime> using namespace std; int main(int argc, char *argv[]) { //cout << "Hello World" << endl; CvCapture *inputVideo = cvCaptureFromFile(argv[1]); IplImage* frame = cvQueryFrame(inputVideo); //IplImage* bwFrame = allocateImage(frame->width, frame->height, IPL_DEPTH_8U, 1); int frameNum = 0; time_t seconds; time_t t0 = time(NULL); while (frame) { ::goToFrameNum(capture, frameNum, frameNum+1000); seconds = time(NULL)-t0; cout << frameNum << " " << seconds << endl; frameNum+=1000; } return 1; }