diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-20 20:41:58 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-20 23:24:16 +0200 |
commit | 06b68ac493f06723d123db5fa23b8c0a86ca7f66 (patch) | |
tree | 6ce50add09ded1603c5f7dfe2811fa3d5b7ad33f /tracker-pt | |
parent | 9da39ce65e42097b5f05eed2ce2cd40cf234ef73 (diff) |
tracker/pt: don't restart camera if nothing's changed
Diffstat (limited to 'tracker-pt')
-rwxr-xr-x | tracker-pt/ftnoir_tracker_pt.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 1e76af04..87e9b2b8 100755 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -229,11 +229,18 @@ void Tracker_PT::apply_settings() break; } - camera.set_res(res_x, res_y); - camera.set_fps(cam_fps); - qDebug() << "camera start"; - camera.start(); - frame = cv::Mat(); + const CamInfo cur = camera.get_desired(); + + if (cur.fps != cam_fps || + cur.res_x != res_x || + cur.res_y != res_y) + { + camera.set_res(res_x, res_y); + camera.set_fps(cam_fps); + qDebug() << "camera start"; + camera.start(); + frame = cv::Mat(); + } qDebug()<<"Tracker::apply ends"; } |