summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt_dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-17 16:11:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-17 16:20:20 +0200
commit159ccb4bca654acdb101cfa1fd3491d1f7964743 (patch)
tree193812dcd731de102271237904055fba970792e7 /tracker-pt/ftnoir_tracker_pt_dialog.cpp
parentc7215393794b7a901cfcca22c9afe200f5bb959e (diff)
tracker/{pt,aruco}: enable camera dialog
Suggested-by: MathijsG Issue: #454
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp39
1 files changed, 36 insertions, 3 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
index 4e1df41b..c722e9a7 100644
--- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp
+++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
@@ -7,6 +7,7 @@
*/
#include "ftnoir_tracker_pt_dialog.h"
+#include "cv/video-property-page.hpp"
#include "compat/camera-names.hpp"
#include <opencv2/core/core.hpp>
@@ -71,6 +72,10 @@ TrackerDialog_PT::TrackerDialog_PT()
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
+ connect(ui.camdevice_combo, &QComboBox::currentTextChanged, this, &TrackerDialog_PT::set_camera_settings_available);
+ set_camera_settings_available(ui.camdevice_combo->currentText());
+ connect(ui.camera_settings, &QPushButton::clicked, this, &TrackerDialog_PT::show_camera_settings);
+
connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info()));
timer.start(250);
@@ -97,9 +102,9 @@ void TrackerDialog_PT::startstop_trans_calib(bool start)
trans_calib_running = false;
{
auto tmp = trans_calib.get_estimate();
- s.t_MH_x = tmp[0];
- s.t_MH_y = tmp[1];
- s.t_MH_z = tmp[2];
+ s.t_MH_x = int(tmp[0]);
+ s.t_MH_y = int(tmp[1]);
+ s.t_MH_z = int(tmp[2]);
}
}
ui.tx_spin->setEnabled(!start);
@@ -144,6 +149,34 @@ void TrackerDialog_PT::poll_tracker_info()
}
}
+void TrackerDialog_PT::set_camera_settings_available(const QString& camera_name)
+{
+#ifdef _WIN32
+ const bool avail = camera_name != QStringLiteral("PS3Eye Camera");
+ ui.camera_settings->setEnabled(avail);
+#elif defined(__linux)
+ (void)camera_name;
+#else
+ (void)camera_name;
+ ui.camera_settings->setEnabled(false);
+#endif
+}
+
+void TrackerDialog_PT::show_camera_settings()
+{
+ const int idx = ui.camdevice_combo->currentIndex();
+ if (tracker)
+ {
+ cv::VideoCapture* cap = tracker->camera;
+ if (cap && cap->isOpened())
+ {
+ video_property_page::show_from_capture(*cap, idx);
+ }
+ }
+ else
+ video_property_page::show(idx);
+}
+
void TrackerDialog_PT::trans_calib_step()
{
if (tracker)