Commits

Nicolas Saunier committed d0419b1

fixing size issue when testing frames in main loop

Comments (0)

Files changed (1)

c/feature-based-tracking.cpp

   capture->setFrameNumber(params.frame1);
   for (unsigned int frameNum = params.frame1; (frameNum < lastFrameNum) && !::interruptionKey(key); frameNum++) {
       bool success = capture->getNextFrame(frame);
-      if (!success || frame.empty() || frame.size() != videoSize) {
+      if (!success || frame.empty()) {
 	cout << "Empty frame " << frameNum << ", breaking (" << success << " " << frame.empty() << " [" << frame.size().width << "x" << frame.size().height << "])" << endl;
 	break;
       } else if (frameNum%50 ==0)
       if (params.undistort) {
 	remap(frame, undistortedFrame, map1, map2, interpolationMethod, BORDER_CONSTANT, 0.);
 	frame = undistortedFrame;
+
+	if (frame.size() != videoSize) {
+	  cout << "Different frame size " << frameNum << ", breaking ([" << frame.size().width << "x" << frame.size().height << "])" << endl;
+	break;
+	}
       }