summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/tracker-easy.cpp
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-04-15 10:08:40 +0200
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commit36df4734dcd3cd50565336e2e81b38971bfc3934 (patch)
treee6918611682c8a4fbd486440886d582fb81a36af /tracker-easy/tracker-easy.cpp
parent14a403d0928bb8ef600017294cafc8b15b1540e7 (diff)
Easy Tracker: Making full size preview optional
Diffstat (limited to 'tracker-easy/tracker-easy.cpp')
-rw-r--r--tracker-easy/tracker-easy.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/tracker-easy/tracker-easy.cpp b/tracker-easy/tracker-easy.cpp
index 7850a23e..e69cbb92 100644
--- a/tracker-easy/tracker-easy.cpp
+++ b/tracker-easy/tracker-easy.cpp
@@ -121,7 +121,10 @@ namespace EasyTracker
QMutexLocker l(&camera_mtx);
if (camera)
+ {
std::tie(iFrame, new_frame) = camera->get_frame();
+ }
+
}
if (new_frame)
@@ -304,8 +307,11 @@ namespace EasyTracker
}
// Show full size preview pop-up
- cv::imshow("Preview", iPreview.iFrameRgb);
- cv::waitKey(1);
+ if (s.debug)
+ {
+ cv::imshow("Preview", iPreview.iFrameRgb);
+ cv::waitKey(1);
+ }
// Update preview widget
widget->update_image(iPreview.get_bitmap());
@@ -321,7 +327,10 @@ namespace EasyTracker
else
{
// No preview, destroy preview pop-up
- cv::destroyWindow("Preview");
+ if (s.debug)
+ {
+ cv::destroyWindow("Preview");
+ }
}
}
}
@@ -331,6 +340,11 @@ namespace EasyTracker
{
QMutexLocker l(&camera_mtx);
+ if (camera->is_open())
+ {
+ return true;
+ }
+
iCameraInfo.fps = s.cam_fps;
iCameraInfo.width = s.cam_res_x;
iCameraInfo.height = s.cam_res_y;