From 36df4734dcd3cd50565336e2e81b38971bfc3934 Mon Sep 17 00:00:00 2001 From: Stéphane Lenclud Date: Mon, 15 Apr 2019 10:08:40 +0200 Subject: Easy Tracker: Making full size preview optional --- tracker-easy/lang/nl_NL.ts | 16 +- tracker-easy/lang/ru_RU.ts | 16 +- tracker-easy/lang/stub.ts | 16 +- tracker-easy/lang/zh_CN.ts | 16 +- tracker-easy/settings.h | 4 +- tracker-easy/tracker-easy-dialog.cpp | 3 +- tracker-easy/tracker-easy-settings.ui | 265 +++++++++++++++------------------- tracker-easy/tracker-easy.cpp | 20 ++- 8 files changed, 152 insertions(+), 204 deletions(-) (limited to 'tracker-easy') diff --git a/tracker-easy/lang/nl_NL.ts b/tracker-easy/lang/nl_NL.ts index b10c7e14..1054e1f7 100644 --- a/tracker-easy/lang/nl_NL.ts +++ b/tracker-easy/lang/nl_NL.ts @@ -81,10 +81,6 @@ px - - Dynamic pose timeout - - Desired capture framerate @@ -101,10 +97,6 @@ Height - - ms - - Device @@ -165,10 +157,6 @@ Blue only - - Dynamic pose (for caps only, never clips) - - Maximum point diameter @@ -274,5 +262,9 @@ Don't roll or change position. Green only + + Debug (full size preview) + + diff --git a/tracker-easy/lang/ru_RU.ts b/tracker-easy/lang/ru_RU.ts index 7f5df2e2..66245b14 100644 --- a/tracker-easy/lang/ru_RU.ts +++ b/tracker-easy/lang/ru_RU.ts @@ -81,10 +81,6 @@ px - - Dynamic pose timeout - Динамическая поза (время ожидания) - Desired capture framerate Желаемая частота кадров @@ -101,14 +97,6 @@ Height Высота - - ms - мс - - - Dynamic pose (for caps only, never clips) - Динамическая поза (Только для модели "Кепка") - Device Устройство @@ -279,5 +267,9 @@ ROLL или X/Y-смещения. Green only + + Debug (full size preview) + + diff --git a/tracker-easy/lang/stub.ts b/tracker-easy/lang/stub.ts index 144b8e76..eca29787 100644 --- a/tracker-easy/lang/stub.ts +++ b/tracker-easy/lang/stub.ts @@ -81,10 +81,6 @@ px - - Dynamic pose timeout - - Desired capture framerate @@ -101,10 +97,6 @@ Height - - ms - - Device @@ -165,10 +157,6 @@ Blue only - - Dynamic pose (for caps only, never clips) - - Maximum point diameter @@ -274,5 +262,9 @@ Don't roll or change position. Green only + + Debug (full size preview) + + diff --git a/tracker-easy/lang/zh_CN.ts b/tracker-easy/lang/zh_CN.ts index 43e121ac..656cb8db 100644 --- a/tracker-easy/lang/zh_CN.ts +++ b/tracker-easy/lang/zh_CN.ts @@ -81,10 +81,6 @@ px 像素点 - - Dynamic pose timeout - 动态姿态超时时间 - Desired capture framerate 期望帧数 @@ -101,10 +97,6 @@ Height 高度 - - ms - 毫秒 - Device 设备名称 @@ -257,10 +249,6 @@ Blue only - - Dynamic pose (for caps only, never clips) - - Value @@ -274,5 +262,9 @@ Don't roll or change position. Green only + + Debug (full size preview) + + diff --git a/tracker-easy/settings.h b/tracker-easy/settings.h index 7d8c7c70..ed5d0abd 100644 --- a/tracker-easy/settings.h +++ b/tracker-easy/settings.h @@ -54,8 +54,8 @@ namespace EasyTracker { value fov{ b, "camera-fov", 56 }; - value dynamic_pose{ b, "dynamic-pose-resolution", false }; - value init_phase_timeout{ b, "init-phase-timeout", 250 }; + value debug{ b, "debug", false }; + value auto_threshold{ b, "automatic-threshold", true }; value blob_color{ b, "blob-color", pt_color_natural }; diff --git a/tracker-easy/tracker-easy-dialog.cpp b/tracker-easy/tracker-easy-dialog.cpp index 0b0dd61d..f56ddfdb 100644 --- a/tracker-easy/tracker-easy-dialog.cpp +++ b/tracker-easy/tracker-easy-dialog.cpp @@ -71,8 +71,7 @@ namespace EasyTracker tie_setting(s.active_model_panel, ui.model_tabs); - tie_setting(s.dynamic_pose, ui.dynamic_pose); - tie_setting(s.init_phase_timeout, ui.init_phase_timeout); + tie_setting(s.debug, ui.debug); tie_setting(s.auto_threshold, ui.auto_threshold); diff --git a/tracker-easy/tracker-easy-settings.ui b/tracker-easy/tracker-easy-settings.ui index 41f08707..4430020d 100644 --- a/tracker-easy/tracker-easy-settings.ui +++ b/tracker-easy/tracker-easy-settings.ui @@ -23,7 +23,7 @@ PointTracker Settings - + :/Resources/tracker-easy-logo.png:/Resources/tracker-easy-logo.png @@ -134,43 +134,50 @@ Camera settings - - + + - + 0 0 - - 10 + + Debug (full size preview) - - + + - + 0 0 - - ° + + Device - - + + camdevice_combo - - 10 + + + + + + + 0 + 0 + - - 90 + + 10 - - + + 0 @@ -178,12 +185,12 @@ - Diagonal field of view + Height - - + + 0 @@ -191,50 +198,38 @@ - Width + Color channels used - - + + - + 0 0 - FPS - - - fps_spin + - - + + 0 0 - - Desired capture height - - - px - - - 2000 - - - 10 + + Open - + 0 @@ -242,44 +237,69 @@ - Dynamic pose timeout + Camera settings (when available) - - + + 0 0 - - Desired capture framerate - - - Hz - - - 2000 - + + + Average + + + + + Natural + + + + + Red only + + + + + Green only + + + + + Blue only + + - - + + 0 0 - + + ° + + + + 10 + + + 90 + - - + + 0 @@ -287,7 +307,7 @@ - Desired capture width + Desired capture height px @@ -300,8 +320,8 @@ - - + + 0 @@ -309,31 +329,12 @@ - Height - - - - - - - - 0 - 0 - - - - ms - - - 50 - - - 5000 + Width - - + + 0 @@ -341,41 +342,31 @@ - Device - - - camdevice_combo + Diagonal field of view - - + + 0 0 - - Open + + Desired capture framerate - - - - - - - 0 - 0 - + + Hz - - Camera settings (when available) + + 2000 - - + + 0 @@ -383,55 +374,32 @@ - Color channels used + FPS + + + fps_spin - - + + 0 0 - - - Average - - - - - Natural - - - - - Red only - - - - - Green only - - - - - Blue only - - - - - - - - - 0 - 0 - + + Desired capture width - - Dynamic pose (for caps only, never clips) + + px + + + 2000 + + + 10 @@ -1349,7 +1317,7 @@ Don't roll or change position. - :/Resources/tracker-easy-logo.png + :/Resources/tracker-easy-logo.png Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -1382,8 +1350,7 @@ Don't roll or change position. res_y_spin fps_spin fov - dynamic_pose - init_phase_timeout + debug camera_settings blob_color auto_threshold 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; -- cgit v1.2.3