summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module/camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:09:38 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:32:11 +0100
commitd4f6dbfa5ff186339f83fe3cf9e191d302b136e4 (patch)
treeacf26375ea29b649326b223b11959a1b9ba1367a /tracker-pt/module/camera.cpp
parentc42f2596e5328c53bcf68e07b471c22aad24c1c7 (diff)
tracker/pt: fix logic error
Diffstat (limited to 'tracker-pt/module/camera.cpp')
-rw-r--r--tracker-pt/module/camera.cpp6
1 files 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);