# HG changeset patch # User Nicolas Saunier # Date 1257958903 18000 # Node ID e77e2fd69b021a59b7ec74f6ea5d3bc71b6e8512 # Parent 068cf45c3f1b64e78143ed33db82060d44843452 modularized code (not compiling) diff -r 068cf45c3f1b -r e77e2fd69b02 c/cvutils.cpp --- a/c/cvutils.cpp Mon Nov 09 01:56:25 2009 -0500 +++ b/c/cvutils.cpp Wed Nov 11 12:01:43 2009 -0500 @@ -18,3 +18,15 @@ return image; } + +void goToFrameNum(CvCapture* capture, const int& currentFrameNum, const int& targetFrameNum) { + if (currentFrameNum > targetFrameNum) + cerr << "Current frame number " << currentFrameNum << " is after the target frame number " << targetFrameNum << "." << endl; + + for (int frameNum = currentFrameNum; frameNumheight; ++i) -// for (int j=0; jwidth; ++j) -// int gray = cvGetReal2D(bwFrame, i, j); + cout << frameNum << " " << seconds << endl; - frame = cvQueryFrame(inputVideo); - frameNum++; + frameNum+=1000; } return 1; diff -r 068cf45c3f1b -r e77e2fd69b02 include/cvutils.hpp --- a/include/cvutils.hpp Mon Nov 09 01:56:25 2009 -0500 +++ b/include/cvutils.hpp Wed Nov 11 12:01:43 2009 -0500 @@ -7,4 +7,6 @@ IplImage* allocateImage(const CvSize& size, const int& depth, const int& channels); +void goToFrameNum(CvCapture* capture, const int& currentFrameNum, const int& targetFrameNum); + #endif