From d4f6dbfa5ff186339f83fe3cf9e191d302b136e4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Dec 2018 19:09:38 +0100 Subject: tracker/pt: fix logic error --- tracker-pt/module/camera.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp index 3dd0df7b..f9d9ff48 100644 --- a/tracker-pt/module/camera.cpp +++ b/tracker-pt/module/camera.cpp @@ -104,10 +104,12 @@ bool Camera::start(int idx, int fps, int res_x, int res_y) cap = camera_ptr(new cv::VideoCapture(idx)); - if (cam_desired.res_x) + if (cam_desired.res_x > 0 && cam_desired.res_y > 0) + { cap->set(cv::CAP_PROP_FRAME_WIDTH, res_x); - if (cam_desired.res_y) cap->set(cv::CAP_PROP_FRAME_HEIGHT, res_y); + } + if (fps > 0) cap->set(cv::CAP_PROP_FPS, fps); -- cgit v1.2.3