diff options
Diffstat (limited to 'tracker-easy')
-rw-r--r-- | tracker-easy/lang/nl_NL.ts | 16 | ||||
-rw-r--r-- | tracker-easy/lang/ru_RU.ts | 16 | ||||
-rw-r--r-- | tracker-easy/lang/stub.ts | 16 | ||||
-rw-r--r-- | tracker-easy/lang/zh_CN.ts | 16 | ||||
-rw-r--r-- | tracker-easy/settings.h | 4 | ||||
-rw-r--r-- | tracker-easy/tracker-easy-dialog.cpp | 3 | ||||
-rw-r--r-- | tracker-easy/tracker-easy-settings.ui | 265 | ||||
-rw-r--r-- | tracker-easy/tracker-easy.cpp | 20 |
8 files changed, 152 insertions, 204 deletions
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 @@ -82,10 +82,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Dynamic pose timeout</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Desired capture framerate</source> <translation type="unfinished"></translation> </message> @@ -102,10 +98,6 @@ <translation type="unfinished"></translation> </message> <message> - <source> ms</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Device</source> <translation type="unfinished"></translation> </message> @@ -166,10 +158,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Dynamic pose (for caps only, never clips)</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Maximum point diameter</source> <translation type="unfinished"></translation> </message> @@ -274,5 +262,9 @@ Don't roll or change position.</source> <source>Green only</source> <translation type="unfinished"></translation> </message> + <message> + <source>Debug (full size preview)</source> + <translation type="unfinished"></translation> + </message> </context> </TS> 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 @@ -82,10 +82,6 @@ <translation></translation> </message> <message> - <source>Dynamic pose timeout</source> - <translation>Динамическая поза (время ожидания)</translation> - </message> - <message> <source>Desired capture framerate</source> <translation>Желаемая частота кадров</translation> </message> @@ -102,14 +98,6 @@ <translation>Высота</translation> </message> <message> - <source> ms</source> - <translation> мс</translation> - </message> - <message> - <source>Dynamic pose (for caps only, never clips)</source> - <translation>Динамическая поза (Только для модели "Кепка")</translation> - </message> - <message> <source>Device</source> <translation>Устройство</translation> </message> @@ -279,5 +267,9 @@ ROLL или X/Y-смещения.</translation> <source>Green only</source> <translation type="unfinished"></translation> </message> + <message> + <source>Debug (full size preview)</source> + <translation type="unfinished"></translation> + </message> </context> </TS> 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 @@ -82,10 +82,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Dynamic pose timeout</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Desired capture framerate</source> <translation type="unfinished"></translation> </message> @@ -102,10 +98,6 @@ <translation type="unfinished"></translation> </message> <message> - <source> ms</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Device</source> <translation type="unfinished"></translation> </message> @@ -166,10 +158,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Dynamic pose (for caps only, never clips)</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Maximum point diameter</source> <translation type="unfinished"></translation> </message> @@ -274,5 +262,9 @@ Don't roll or change position.</source> <source>Green only</source> <translation type="unfinished"></translation> </message> + <message> + <source>Debug (full size preview)</source> + <translation type="unfinished"></translation> + </message> </context> </TS> 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 @@ -82,10 +82,6 @@ <translation> 像素点</translation> </message> <message> - <source>Dynamic pose timeout</source> - <translation>动态姿态超时时间</translation> - </message> - <message> <source>Desired capture framerate</source> <translation>期望帧数</translation> </message> @@ -102,10 +98,6 @@ <translation>高度</translation> </message> <message> - <source> ms</source> - <translation> 毫秒</translation> - </message> - <message> <source>Device</source> <translation>设备名称</translation> </message> @@ -258,10 +250,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Dynamic pose (for caps only, never clips)</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Value</source> <translation type="unfinished"></translation> </message> @@ -274,5 +262,9 @@ Don't roll or change position.</source> <source>Green only</source> <translation type="unfinished"></translation> </message> + <message> + <source>Debug (full size preview)</source> + <translation type="unfinished"></translation> + </message> </context> </TS> 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<int> fov{ b, "camera-fov", 56 }; - value<bool> dynamic_pose{ b, "dynamic-pose-resolution", false }; - value<int> init_phase_timeout{ b, "init-phase-timeout", 250 }; + value<bool> debug{ b, "debug", false }; + value<bool> auto_threshold{ b, "automatic-threshold", true }; value<pt_color_type> 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 @@ <string>PointTracker Settings</string> </property> <property name="windowIcon"> - <iconset resource="tracker_easy.qrc"> + <iconset> <normaloff>:/Resources/tracker-easy-logo.png</normaloff>:/Resources/tracker-easy-logo.png</iconset> </property> <property name="layoutDirection"> @@ -134,43 +134,50 @@ <string>Camera settings</string> </property> <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="1"> - <widget class="QComboBox" name="camdevice_combo"> + <item row="5" column="0"> + <widget class="QLabel" name="label_5"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumContentsLength"> - <number>10</number> + <property name="text"> + <string>Debug (full size preview)</string> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QSpinBox" name="fov"> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="suffix"> - <string>°</string> + <property name="text"> + <string>Device</string> </property> - <property name="prefix"> - <string/> + <property name="buddy"> + <cstring>camdevice_combo</cstring> </property> - <property name="minimum"> - <number>10</number> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="camdevice_combo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="maximum"> - <number>90</number> + <property name="minimumContentsLength"> + <number>10</number> </property> </widget> </item> - <item row="4" column="0"> - <widget class="QLabel" name="label_4"> + <item row="2" column="0"> + <widget class="QLabel" name="label_41"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -178,12 +185,12 @@ </sizepolicy> </property> <property name="text"> - <string>Diagonal field of view</string> + <string>Height</string> </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_36"> + <item row="7" column="0"> + <widget class="QLabel" name="label_12"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -191,50 +198,38 @@ </sizepolicy> </property> <property name="text"> - <string>Width</string> + <string>Color channels used</string> </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_37"> + <item row="5" column="1"> + <widget class="QCheckBox" name="debug"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>FPS</string> - </property> - <property name="buddy"> - <cstring>fps_spin</cstring> + <string/> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QSpinBox" name="res_y_spin"> + <item row="6" column="1"> + <widget class="QPushButton" name="camera_settings"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Desired capture height</string> - </property> - <property name="suffix"> - <string> px</string> - </property> - <property name="maximum"> - <number>2000</number> - </property> - <property name="singleStep"> - <number>10</number> + <property name="text"> + <string>Open</string> </property> </widget> </item> <item row="6" column="0"> - <widget class="QLabel" name="label_6"> + <widget class="QLabel" name="label_9"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -242,44 +237,69 @@ </sizepolicy> </property> <property name="text"> - <string>Dynamic pose timeout</string> + <string>Camera settings (when available)</string> </property> </widget> </item> - <item row="3" column="1"> - <widget class="QSpinBox" name="fps_spin"> + <item row="7" column="1"> + <widget class="QComboBox" name="blob_color"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="toolTip"> - <string>Desired capture framerate</string> - </property> - <property name="suffix"> - <string> Hz</string> - </property> - <property name="maximum"> - <number>2000</number> - </property> + <item> + <property name="text"> + <string>Average</string> + </property> + </item> + <item> + <property name="text"> + <string>Natural</string> + </property> + </item> + <item> + <property name="text"> + <string>Red only</string> + </property> + </item> + <item> + <property name="text"> + <string>Green only</string> + </property> + </item> + <item> + <property name="text"> + <string>Blue only</string> + </property> + </item> </widget> </item> - <item row="5" column="1"> - <widget class="QCheckBox" name="dynamic_pose"> + <item row="4" column="1"> + <widget class="QSpinBox" name="fov"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> + <property name="suffix"> + <string>°</string> + </property> + <property name="prefix"> <string/> </property> + <property name="minimum"> + <number>10</number> + </property> + <property name="maximum"> + <number>90</number> + </property> </widget> </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="res_x_spin"> + <item row="2" column="1"> + <widget class="QSpinBox" name="res_y_spin"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -287,7 +307,7 @@ </sizepolicy> </property> <property name="toolTip"> - <string>Desired capture width</string> + <string>Desired capture height</string> </property> <property name="suffix"> <string> px</string> @@ -300,8 +320,8 @@ </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_41"> + <item row="1" column="0"> + <widget class="QLabel" name="label_36"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -309,31 +329,12 @@ </sizepolicy> </property> <property name="text"> - <string>Height</string> - </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QSpinBox" name="init_phase_timeout"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="suffix"> - <string> ms</string> - </property> - <property name="minimum"> - <number>50</number> - </property> - <property name="maximum"> - <number>5000</number> + <string>Width</string> </property> </widget> </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_2"> + <item row="4" column="0"> + <widget class="QLabel" name="label_4"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -341,41 +342,31 @@ </sizepolicy> </property> <property name="text"> - <string>Device</string> - </property> - <property name="buddy"> - <cstring>camdevice_combo</cstring> + <string>Diagonal field of view</string> </property> </widget> </item> - <item row="7" column="1"> - <widget class="QPushButton" name="camera_settings"> + <item row="3" column="1"> + <widget class="QSpinBox" name="fps_spin"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Open</string> + <property name="toolTip"> + <string>Desired capture framerate</string> </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="label_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="suffix"> + <string> Hz</string> </property> - <property name="text"> - <string>Camera settings (when available)</string> + <property name="maximum"> + <number>2000</number> </property> </widget> </item> - <item row="8" column="0"> - <widget class="QLabel" name="label_12"> + <item row="3" column="0"> + <widget class="QLabel" name="label_37"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -383,55 +374,32 @@ </sizepolicy> </property> <property name="text"> - <string>Color channels used</string> + <string>FPS</string> + </property> + <property name="buddy"> + <cstring>fps_spin</cstring> </property> </widget> </item> - <item row="8" column="1"> - <widget class="QComboBox" name="blob_color"> + <item row="1" column="1"> + <widget class="QSpinBox" name="res_x_spin"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <item> - <property name="text"> - <string>Average</string> - </property> - </item> - <item> - <property name="text"> - <string>Natural</string> - </property> - </item> - <item> - <property name="text"> - <string>Red only</string> - </property> - </item> - <item> - <property name="text"> - <string>Green only</string> - </property> - </item> - <item> - <property name="text"> - <string>Blue only</string> - </property> - </item> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="toolTip"> + <string>Desired capture width</string> </property> - <property name="text"> - <string>Dynamic pose (for caps only, never clips)</string> + <property name="suffix"> + <string> px</string> + </property> + <property name="maximum"> + <number>2000</number> + </property> + <property name="singleStep"> + <number>10</number> </property> </widget> </item> @@ -1349,7 +1317,7 @@ Don't roll or change position.</string> <string/> </property> <property name="pixmap"> - <pixmap resource="tracker_easy.qrc">:/Resources/tracker-easy-logo.png</pixmap> + <pixmap>:/Resources/tracker-easy-logo.png</pixmap> </property> <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -1382,8 +1350,7 @@ Don't roll or change position.</string> <tabstop>res_y_spin</tabstop> <tabstop>fps_spin</tabstop> <tabstop>fov</tabstop> - <tabstop>dynamic_pose</tabstop> - <tabstop>init_phase_timeout</tabstop> + <tabstop>debug</tabstop> <tabstop>camera_settings</tabstop> <tabstop>blob_color</tabstop> <tabstop>auto_threshold</tabstop> 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; |