# HG changeset patch # User Nicolas Saunier # Date 1340835094 14400 # Node ID 23da16442433780e689f7f207cc1e54527d04267 # Parent b7612c6d570246224073fb4f1f83a87cc1c6aae8 minor modifications for unsigned int (nframes is now 0 to process all frames) diff -r b7612c6d5702 -r 23da16442433 c/feature-based-tracking.cpp --- a/c/feature-based-tracking.cpp Wed Jun 27 09:52:06 2012 -0400 +++ b/c/feature-based-tracking.cpp Wed Jun 27 18:11:34 2012 -0400 @@ -80,7 +80,7 @@ VideoCapture capture; Size videoSize; - int nFrames = -1; + unsigned int nFrames = 0; capture.open(params.videoFilename); if(capture.isOpened()) { videoSize = Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)); @@ -127,9 +127,9 @@ unsigned int savedFeatureId=0; Mat frame, currentFrameBW, previousFrameBW; - unsigned int lastFrameNum = nFrames; - if (params.nFrames >= 0) - lastFrameNum = min(params.frame1+params.nFrames, nFrames); + unsigned int lastFrameNum = params.frame1+nFrames; + if (params.nFrames > 0) + lastFrameNum = MIN(params.frame1+params.nFrames, nFrames); capture.set(CV_CAP_PROP_POS_FRAMES, params.frame1); for (unsigned int frameNum = params.frame1; (frameNum < lastFrameNum) && !::interruptionKey(key); frameNum++) { diff -r b7612c6d5702 -r 23da16442433 include/Parameters.hpp --- a/include/Parameters.hpp Wed Jun 27 09:52:06 2012 -0400 +++ b/include/Parameters.hpp Wed Jun 27 18:11:34 2012 -0400 @@ -24,8 +24,8 @@ bool display; float videoFPS; // int measurementPrecision; - int frame1; - int nFrames; + unsigned int frame1; + unsigned int nFrames; // feature tracking int maxNFeatures; float featureQuality; diff -r b7612c6d5702 -r 23da16442433 tracking.cfg --- a/tracking.cfg Wed Jun 27 09:52:06 2012 -0400 +++ b/tracking.cfg Wed Jun 27 18:11:34 2012 -0400 @@ -16,8 +16,8 @@ # measurement-precision = 3 # first frame to process frame1 = 0 -# number of frame to process -nframes = -1 +# number of frame to process: 0 means processing all frames +nframes = 0 # feature tracking # maximum number of features added at each frame max-nfeatures = 1000