From 9f9e04b576a579d96e339cb2339a71f4405af50b Mon Sep 17 00:00:00 2001 From: Alex Schmidt Date: Fri, 11 Oct 2013 12:55:42 +0200 Subject: [PATCH 1/1] ... --- stickletrack.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stickletrack.cpp b/stickletrack.cpp index c5c8504..7022276 100755 --- a/stickletrack.cpp +++ b/stickletrack.cpp @@ -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*[BACKSECONDS*Props.fps]; -- 2.39.5