From fab2afe75c7ab809d810ab6a7b263801a0dc1f1a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jun 2015 10:05:44 +0200 Subject: trackhat: more stubs --- CMakeLists.txt | 14 +- facetracknoir/images/trackhat-cap.png | Bin 0 -> 50018 bytes facetracknoir/images/trackhat-clip.png | Bin 0 -> 61942 bytes facetracknoir/options-dialog.cpp | 24 +- facetracknoir/options-dialog.hpp | 2 + facetracknoir/settings.ui | 447 ++++++++++++++++++------- facetracknoir/ui-res.qrc | 2 + ftnoir_tracker_pt/FTNoIR_PT_Controls.ui | 260 +------------- ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp | 38 +-- ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h | 43 +-- opentrack/main-settings.hpp | 2 - 11 files changed, 360 insertions(+), 472 deletions(-) create mode 100644 facetracknoir/images/trackhat-cap.png create mode 100644 facetracknoir/images/trackhat-clip.png diff --git a/CMakeLists.txt b/CMakeLists.txt index 4413f712..65d6e369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -find_package(OpenCV 3.0) +find_package(OpenCV 3.0 REQUIRED) find_package(Qt5 REQUIRED COMPONENTS Core Xml Network Widgets Gui QUIET) find_package(Qt5 COMPONENTS SerialPort QUIET) @@ -83,13 +83,17 @@ macro(opentrack_qt n) endmacro() macro(opentrack_library n dir) - cmake_parse_arguments(foolib "" "LINK;COMPILE;GNU-LINK;GNU-COMPILE" "" ${ARGN}) + cmake_parse_arguments(foolib "" "LINK;COMPILE;GNU-LINK;GNU-COMPILE;STATIC" "" ${ARGN}) if(NOT " ${foolib_UNPARSED_ARGUMENTS}" STREQUAL " ") message(FATAL_ERROR "opentrack_library bad formals") endif() opentrack_module(${n} ${dir}) opentrack_qt(${n}) - add_library(${n} SHARED ${${n}-all}) + set(link-mode SHARED) + if (STATIC) + set(link-mode STATIC) + endif() + add_library(${n} ${link-mode} ${${n}-all}) target_link_libraries(${n} ${MY_QT_LIBS}) if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE) SET_TARGET_PROPERTIES(${n} PROPERTIES @@ -99,7 +103,9 @@ macro(opentrack_library n dir) else() set_target_properties(${n} PROPERTIES LINK_FLAGS ${foolib_LINK} COMPILE_FLAGS ${foolib_COMPILE}) endif() - install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) + if (NOT STATIC) + install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) + endif() endmacro() function(link_with_dinput8 n) diff --git a/facetracknoir/images/trackhat-cap.png b/facetracknoir/images/trackhat-cap.png new file mode 100644 index 00000000..7ce4bd1a Binary files /dev/null and b/facetracknoir/images/trackhat-cap.png differ diff --git a/facetracknoir/images/trackhat-clip.png b/facetracknoir/images/trackhat-clip.png new file mode 100644 index 00000000..3320f831 Binary files /dev/null and b/facetracknoir/images/trackhat-clip.png differ diff --git a/facetracknoir/options-dialog.cpp b/facetracknoir/options-dialog.cpp index 4489e502..9afeba7c 100644 --- a/facetracknoir/options-dialog.cpp +++ b/facetracknoir/options-dialog.cpp @@ -35,13 +35,6 @@ OptionsDialog::OptionsDialog() tie_setting(s.s_main.tcomp_p, ui.tcomp_enable); tie_setting(s.s_main.tcomp_tz, ui.tcomp_rz); - tie_setting(s.s_main.a_x.zero, ui.pos_tx); - tie_setting(s.s_main.a_y.zero, ui.pos_ty); - tie_setting(s.s_main.a_z.zero, ui.pos_tz); - tie_setting(s.s_main.a_yaw.zero, ui.pos_rx); - tie_setting(s.s_main.a_pitch.zero, ui.pos_ry); - tie_setting(s.s_main.a_roll.zero, ui.pos_rz); - tie_setting(s.s_main.a_yaw.invert, ui.invert_yaw); tie_setting(s.s_main.a_pitch.invert, ui.invert_pitch); tie_setting(s.s_main.a_roll.invert, ui.invert_roll); @@ -59,10 +52,26 @@ OptionsDialog::OptionsDialog() tie_setting(s.s_main.camera_yaw, ui.camera_yaw); tie_setting(s.s_main.camera_pitch, ui.camera_pitch); tie_setting(s.s_main.camera_roll, ui.camera_roll); + + tie_setting(pt.camera_mode, ui.camera_mode); + + tie_setting(pt.threshold, ui.threshold_slider); + + tie_setting(pt.min_point_size, ui.mindiam_spin); + tie_setting(pt.max_point_size, ui.maxdiam_spin); + + tie_setting(pt.t_MH_x, ui.tx_spin); + tie_setting(pt.t_MH_y, ui.ty_spin); + tie_setting(pt.t_MH_z, ui.tz_spin); + + tie_setting(pt.fov, ui.camera_fov); + + tie_setting(pt.is_cap, ui.model_cap); } void OptionsDialog::doOK() { s.b->save(); + pt.b->save(); s.s_main.b->save(); ui.game_detector->save(); this->close(); @@ -71,6 +80,7 @@ void OptionsDialog::doOK() { void OptionsDialog::doCancel() { s.b->reload(); + pt.b->reload(); s.s_main.b->reload(); ui.game_detector->revert(); close(); diff --git a/facetracknoir/options-dialog.hpp b/facetracknoir/options-dialog.hpp index 71a3acda..33ae1810 100644 --- a/facetracknoir/options-dialog.hpp +++ b/facetracknoir/options-dialog.hpp @@ -4,6 +4,7 @@ #include #include "ui_settings.h" #include "opentrack/shortcuts.h" +#include "ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h" class OptionsDialog: public QWidget { @@ -15,6 +16,7 @@ public: private: Ui::UI_Settings ui; Shortcuts::settings s; + settings_pt pt; private slots: void doOK(); void doCancel(); diff --git a/facetracknoir/settings.ui b/facetracknoir/settings.ui index 34b15b47..240ed522 100644 --- a/facetracknoir/settings.ui +++ b/facetracknoir/settings.ui @@ -6,8 +6,8 @@ 0 0 - 348 - 548 + 462 + 522 @@ -296,7 +296,7 @@ Camera - + @@ -404,201 +404,402 @@ - + - Center pose offset + Device - - - + + + - Alter the centered position sent to games by a fixed amount. - - - true + Mode - - 2 + + + + + + + 640x480, 75 Hz + + + + + 640x480, 60 Hz + + + + + 320x240, 189 Hz + + + + + 320x240, 120 Hz + + + + + + + + Field of view + + + + + 56° + + + + + 75° + + + + + + + + + + + Point extraction + + - - - QGroupBox { - border: 0; -} - - - + + + QFrame::StyledPanel - - Qt::AlignCenter - - - false - - - false + + QFrame::Raised - - - - - deg. + + + + + Threshold - - 3 + + threshold_slider - - -180.000000000000000 + + + + + + Intensity threshold for point extraction - 180.000000000000000 + 255 + + + 1 + + + 127 + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 25 - - - - cm + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + Min size - - 3 + + mindiam_spin - - -100.000000000000000 + + + + + + Minimum point diameter + + + px - 100.000000000000000 + 1024 - + - TX + Max size + + + maxdiam_spin - - - cm - - - 3 + + + Maximum point diameter - - -100.000000000000000 + + px - 100.000000000000000 + 1024 - - - - RY + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Model + + + + + + QGroupBox { border: 0; } + + + + + + + + 10 + 10 + 82 + 17 + + + + Cap + + + true + + + + + + 10 + 140 + 82 + 17 + + + + Clip + + + + + + 80 + 0 + 171 + 121 + + + + + + + :/images/trackhat-cap.png + + + true + + + + + + 70 + 130 + 201 + 161 + + + + + + + :/images/trackhat-clip.png + + + true + + + + + + + + + 0 + 0 + + + + Model position + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + + 0 + 0 + - - - - - TY + x: - - + + - deg. - - - 3 + mm - -180.000000000000000 + -65535 - 180.000000000000000 + 65536 - - - - TZ + + + + + 0 + 0 + - - - - - RZ + y: - - + + - cm - - - 3 + mm - -100.000000000000000 + -65535 - 100.000000000000000 + 65536 - - + + + + + 0 + 0 + + - RX + z: - - + + - deg. - - - 3 + mm - -180.000000000000000 + -65535 - 180.000000000000000 + 65536 + + + + <html><head/><body><p>Only pitch and yaw during calibration.</p><p>Don't roll and don't translate.</p></body></html> + + + + + + + false + + + Toggle calibration + + + true + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -1170,12 +1371,6 @@ camera_yaw camera_pitch camera_roll - pos_rx - pos_ry - pos_rz - pos_tx - pos_ty - pos_tz tcomp_enable tcomp_rz src_yaw @@ -1191,7 +1386,9 @@ src_z invert_z - + + + startEngineClicked() diff --git a/facetracknoir/ui-res.qrc b/facetracknoir/ui-res.qrc index 030a6153..b251ab8f 100644 --- a/facetracknoir/ui-res.qrc +++ b/facetracknoir/ui-res.qrc @@ -6,5 +6,7 @@ images/facetracknoir.png images/no-feed.png images/filter-16.png + images/trackhat-cap.png + images/trackhat-clip.png diff --git a/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui b/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui index 0e6048c3..15062a8d 100644 --- a/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui +++ b/ftnoir_tracker_pt/FTNoIR_PT_Controls.ui @@ -54,7 +54,7 @@ - 0 + 1 @@ -253,131 +253,6 @@ - - - - Point extraction - - - - - - Minimum point diameter - - - px - - - 1024 - - - - - - - Intensity threshold for point extraction - - - 255 - - - 1 - - - 127 - - - Qt::Horizontal - - - QSlider::TicksBothSides - - - 25 - - - - - - - Maximum point diameter - - - px - - - 1024 - - - - - - - Max size - - - maxdiam_spin - - - - - - - Per pixel hysteresis width (leave left if there is little difference between dot and non-dot, move right for increased stability against pixel noise) - - - 255 - - - 1 - - - 100 - - - Qt::Horizontal - - - QSlider::TicksBothSides - - - 25 - - - - - - - Threshold - - - threshold_slider - - - - - - - Hysteresis - - - threshold_secondary_slider - - - - - - - Min size - - - mindiam_spin - - - - - - @@ -916,131 +791,6 @@ - - - - - 0 - 0 - - - - Model position - - - - - - QFrame::NoFrame - - - QFrame::Raised - - - - - - - 0 - 0 - - - - x: - - - - - - - mm - - - -65535 - - - 65536 - - - - - - - - 0 - 0 - - - - y: - - - - - - - mm - - - -65535 - - - 65536 - - - - - - - - 0 - 0 - - - - z: - - - - - - - mm - - - -65535 - - - 65536 - - - - - - - - - - <html><head/><body><p>Only pitch and yaw during calibration.</p><p>Don't roll and don't translate.</p></body></html> - - - - - - - false - - - Toggle calibration - - - true - - - - - - @@ -1149,10 +899,6 @@ res_y_spin fps_spin fov - threshold_slider - mindiam_spin - threshold_secondary_slider - maxdiam_spin model_tabs clip_tlength_spin clip_theight_spin @@ -1167,10 +913,6 @@ m2x_spin m2y_spin m2z_spin - tx_spin - ty_spin - tz_spin - tcalib_button diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp index 86178cb3..6f78b141 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp @@ -39,43 +39,7 @@ TrackerDialog_PT::TrackerDialog_PT() } #endif - tie_setting(s.camera_name, ui.camdevice_combo); - tie_setting(s.cam_res_x, ui.res_x_spin); - tie_setting(s.cam_res_y, ui.res_y_spin); - tie_setting(s.cam_fps, ui.fps_spin); - - tie_setting(s.threshold_secondary, ui.threshold_secondary_slider); - tie_setting(s.threshold, ui.threshold_slider); - - tie_setting(s.min_point_size, ui.mindiam_spin); - tie_setting(s.max_point_size, ui.maxdiam_spin); - - tie_setting(s.clip_by, ui.clip_bheight_spin); - tie_setting(s.clip_bz, ui.clip_blength_spin); - tie_setting(s.clip_ty, ui.clip_theight_spin); - tie_setting(s.clip_tz, ui.clip_tlength_spin); - - tie_setting(s.cap_x, ui.cap_width_spin); - tie_setting(s.cap_y, ui.cap_height_spin); - tie_setting(s.cap_z, ui.cap_length_spin); - - tie_setting(s.m01_x, ui.m1x_spin); - tie_setting(s.m01_y, ui.m1y_spin); - tie_setting(s.m01_z, ui.m1z_spin); - - tie_setting(s.m02_x, ui.m2x_spin); - tie_setting(s.m02_y, ui.m2y_spin); - tie_setting(s.m02_z, ui.m2z_spin); - - tie_setting(s.t_MH_x, ui.tx_spin); - tie_setting(s.t_MH_y, ui.ty_spin); - tie_setting(s.t_MH_z, ui.tz_spin); - - tie_setting(s.fov, ui.fov); - - tie_setting(s.active_model_panel, ui.model_tabs); - - tie_setting(s.dynamic_pose, ui.dynamic_pose); + connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) ); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h index 30647412..1abb8897 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h @@ -8,63 +8,30 @@ #ifndef FTNOIR_TRACKER_PT_SETTINGS_H #define FTNOIR_TRACKER_PT_SETTINGS_H -#include - #include "opentrack/options.hpp" using namespace options; struct settings_pt : opts { - value camera_name; - value cam_res_x, - cam_res_y, - cam_fps, - threshold, - threshold_secondary, + value threshold, min_point_size, max_point_size; - value m01_x, m01_y, m01_z; - value m02_x, m02_y, m02_z; - value t_MH_x, t_MH_y, t_MH_z; - - value clip_ty, clip_tz, clip_by, clip_bz; - value active_model_panel, cap_x, cap_y, cap_z; - - value fov; - - value dynamic_pose; + value fov, camera_mode; + value is_cap; settings_pt() : opts("tracker-pt"), - camera_name(b, "camera-name", ""), - cam_res_x(b, "camera-res-width", 640), - cam_res_y(b, "camera-res-height", 480), - cam_fps(b, "camera-fps", 30), threshold(b, "threshold-primary", 128), - threshold_secondary(b, "threshold-secondary", 128), min_point_size(b, "min-point-size", 10), max_point_size(b, "max-point-size", 50), - m01_x(b, "m_01-x", 0), - m01_y(b, "m_01-y", 0), - m01_z(b, "m_01-z", 0), - m02_x(b, "m_02-x", 0), - m02_y(b, "m_02-y", 0), - m02_z(b, "m_02-z", 0), t_MH_x(b, "model-centroid-x", 0), t_MH_y(b, "model-centroid-y", 0), t_MH_z(b, "model-centroid-z", 0), - clip_ty(b, "clip-ty", 0), - clip_tz(b, "clip-tz", 0), - clip_by(b, "clip-by", 0), - clip_bz(b, "clip-bz", 0), - active_model_panel(b, "active-model-panel", 0), - cap_x(b, "cap-x", 0), - cap_y(b, "cap-y", 0), - cap_z(b, "cap-z", 0), fov(b, "camera-fov", 56), - dynamic_pose(b, "dynamic-pose-resolution", true) + camera_mode(b, "camera-mode", 0), + is_cap(b, "model-is-cap", true) {} }; diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index 250d4563..f47b3873 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -7,11 +7,9 @@ using namespace options; struct axis_opts { - value zero; value invert, altp; value src; axis_opts(pbundle b, QString pfx, int idx) : - zero(b, n(pfx, "zero-pos"), 0), invert(b, n(pfx, "invert-sign"), false), altp(b, n(pfx, "alt-axis-sign"), false), src(b, n(pfx, "source-index"), idx) -- cgit v1.2.3