From 3d6b9c0d3497eee46a57e0145e5552a68626fb0e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 6 Jul 2017 02:25:50 +0200 Subject: cv/calibrator: return distinct sample count for all DOF --- tracker-pt/ftnoir_tracker_pt_dialog.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index c2079c27..ee80fe6f 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -104,16 +104,31 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) qDebug() << "pt: stopping translation calibration"; { cv::Vec3f tmp; - unsigned nsamples; + cv::Vec3i nsamples; std::tie(tmp, nsamples) = trans_calib.get_estimate(); s.t_MH_x = int(tmp[0]); s.t_MH_y = int(tmp[1]); s.t_MH_z = int(tmp[2]); - static constexpr unsigned min_samples = 80; - const QString sample_feedback = nsamples >= min_samples - ? tr("%1 samples. Over %2, good!").arg(nsamples).arg(min_samples) - : tr("%1 samples. Try for at least %2 for a precise calibration.").arg(nsamples).arg(min_samples); + static constexpr unsigned min_yaw_samples = 15; + static constexpr unsigned min_pitch_samples = 15; + static constexpr unsigned min_samples = min_yaw_samples+min_pitch_samples; + + // Don't bother counting roll samples. Roll calibration is hard enough + // that it's a hidden unsupported feature anyway. + + const QString sample_feedback = progn( + if (nsamples[0] < min_yaw_samples) + return tr("%1 yaw samples. Yaw more to %2 samples for stable calibration.") + .arg(nsamples[0]).arg(min_yaw_samples); + if (nsamples[1] < min_pitch_samples) + return tr("%1 pitch samples. Pitch more to %2 samples for stable calibration.") + .arg(nsamples[1]).arg(min_pitch_samples); + + const unsigned nsamples_total = nsamples[0] + nsamples[1]; + + return tr("%1 samples. Over %2, good!").arg(nsamples_total).arg(min_samples); + ); ui.sample_count_display->setText(sample_feedback); } -- cgit v1.2.3 From 963cad86f4ef9941bd272b41d449adc13d742488 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 11:13:20 +0200 Subject: tracker/pt: don't return zero pose on failure Issue: #644 --- tracker-pt/ftnoir_tracker_pt.cpp | 2 -- tracker-pt/point_tracker.h | 1 - 2 files changed, 3 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index f4e60bba..938acc1c 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -92,8 +92,6 @@ void Tracker_PT::run() s.dynamic_pose ? s.init_phase_timeout : 0); ever_success = true; } - else - point_tracker.invalidate_pose(); { Affine X_CM; diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index b867cea4..a25c1458 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -62,7 +62,6 @@ public: Affine pose() { return X_CM; } vec2 project(const vec3& v_M, f focal_length); vec2 project(const vec3& v_M, f focal_length, const Affine& X_CM); - void invalidate_pose() { X_CM = Affine(); } private: // the points in model order -- cgit v1.2.3 From b0088e4ecb6673ac74ad25ee2195e29345fa3add Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 12:10:05 +0200 Subject: tracker/pt: reduce LED deadzone It qualifies far less often now, but will likely reduce jerkiness. --- tracker-pt/point_tracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index 4022cbb2..73745d8f 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -162,7 +162,7 @@ bool PointTracker::maybe_use_old_point_order(const PointOrder& order, const CamI } // CAVEAT don't increase too much, it visibly loses precision - static constexpr f max_dist = f(.35); + static constexpr f max_dist = f(.2); const bool validp = sum < max_dist; @@ -178,7 +178,7 @@ bool PointTracker::maybe_use_old_point_order(const PointOrder& order, const CamI { static Timer tt; static int cnt1 = 0, cnt2 = 0; - if (tt.elapsed_ms() >= 5000) + if (tt.elapsed_ms() >= 1000) { tt.start(); if (cnt1 + cnt2) -- cgit v1.2.3 From f013741288cbbd9a2e70aea727cbb80cf72d10cc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Jul 2017 13:10:57 +0200 Subject: tracker/pt: specify dynamic pose is only for caps Reported-by: @Len62 as https://github.com/opentrack/opentrack/issues/644#issuecomment-313649989 --- tracker-pt/FTNoIR_PT_Controls.ui | 2 +- tracker-pt/ftnoir_tracker_pt_settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/FTNoIR_PT_Controls.ui b/tracker-pt/FTNoIR_PT_Controls.ui index 62b49747..8d044654 100644 --- a/tracker-pt/FTNoIR_PT_Controls.ui +++ b/tracker-pt/FTNoIR_PT_Controls.ui @@ -250,7 +250,7 @@ - Dynamic pose resolution + Dynamic pose (for caps only, never clips) diff --git a/tracker-pt/ftnoir_tracker_pt_settings.h b/tracker-pt/ftnoir_tracker_pt_settings.h index d890bbd2..79c1e103 100644 --- a/tracker-pt/ftnoir_tracker_pt_settings.h +++ b/tracker-pt/ftnoir_tracker_pt_settings.h @@ -62,7 +62,7 @@ struct settings_pt : opts cap_z(b, "cap-z", 100), fov(b, "camera-fov", 56), dynamic_pose(b, "dynamic-pose-resolution", true), - init_phase_timeout(b, "init-phase-timeout", 500), + init_phase_timeout(b, "init-phase-timeout", 250), auto_threshold(b, "automatic-threshold", true) {} }; -- cgit v1.2.3