]> git.treefish.org Git - stickletrack.git/commitdiff
...
authorAlex Schmidt <alex@treefish.org>
Fri, 11 Oct 2013 10:55:42 +0000 (12:55 +0200)
committerAlex Schmidt <alex@treefish.org>
Fri, 11 Oct 2013 10:55:42 +0000 (12:55 +0200)
stickletrack.cpp

index c5c8504dc0889dac29b4fcde422a6e1a9c256aef..7022276221b52da0891d38e0ff97c01f6e64f195 100755 (executable)
@@ -373,6 +373,15 @@ int process(VideoCapture& capture) {
   Props.totframes = capture.get(CV_CAP_PROP_FRAME_COUNT);
   Props.diagonal = sqrt( pow(Props.width, 2) + pow(Props.height, 2) );
 
+  if ( Props.width == 0 || Props.height == 0 || Props.fps == 0 || Props.totframes == 0 ) {
+    cerr << "Something got wrong while reading video-file info!" << endl;
+    cerr << "Width: " << Props.width << endl;
+    cerr << "Height: " << Props.height << endl;
+    cerr << "FPS: " << Props.fps << endl;
+    cerr << "Total frames: " << Props.totframes << endl;
+    exit(1);
+  }
+
   Mat frameintime[BACKSECONDS*Props.fps];
 
   tagintime = new vector<tag>*[BACKSECONDS*Props.fps];