diff options
Diffstat (limited to 'tracker-pt/module/camera.cpp')
-rw-r--r-- | tracker-pt/module/camera.cpp | 6 |
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); |