# HG changeset patch # User Nicolas Saunier # Date 1433463950 -7200 # Node ID acce61a1edc88054a3188fa68a38d79de01d67a7 # Parent da1352b89d020ff310cbe35f09c6f452de31b595# Parent 576d9ea4b41a610d436036508165163fd8dca8f5 merged bug fix with stable diff -r da1352b89d02 -r acce61a1edc8 c/feature-based-tracking.cpp --- a/c/feature-based-tracking.cpp Fri Jun 05 02:25:30 2015 +0200 +++ b/c/feature-based-tracking.cpp Fri Jun 05 02:25:50 2015 +0200 @@ -21,6 +21,7 @@ #include #include #include +#include using namespace std; using namespace cv; @@ -101,6 +102,12 @@ Size videoSize = Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)); unsigned int nFrames = capture.get(CV_CAP_PROP_FRAME_COUNT); + if (nFrames <= 0) { + cout << "Guessing that the number of frames could not be read: " << nFrames << endl; + nFrames = numeric_limits::max(); + cout << "Setting arbitrarily high number for testing: " << nFrames << endl; + } + cout << "Video " << params.videoFilename << ": width=" << videoSize.width << ", height=" << videoSize.height <<