Mercurial Hosting > traffic-intelligence
changeset 228:23da16442433
minor modifications for unsigned int (nframes is now 0 to process all frames)
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 27 Jun 2012 18:11:34 -0400 |
parents | b7612c6d5702 |
children | 6e73b112370b |
files | c/feature-based-tracking.cpp include/Parameters.hpp tracking.cfg |
diffstat | 3 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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++) {
--- 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;
--- 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