summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorattila-csipa <attila.csipa@hp.com>2017-07-07 13:16:16 +0100
committerattila-csipa <attila.csipa@hp.com>2017-07-07 13:16:16 +0100
commit5ded46a80ec82137869ebd234189b1fd9ffff680 (patch)
treefeac22663567716e51133734d7592da64adfd239 /tracker-pt
parent816c857c513e42a0b2583c2ab7bd89610f968f93 (diff)
parentf013741288cbbd9a2e70aea727cbb80cf72d10cc (diff)
Merge remote-tracking branch 'upstream/unstable' into unstable
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/FTNoIR_PT_Controls.ui2
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp2
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp25
-rw-r--r--tracker-pt/ftnoir_tracker_pt_settings.h2
-rw-r--r--tracker-pt/point_tracker.cpp4
-rw-r--r--tracker-pt/point_tracker.h1
6 files changed, 24 insertions, 12 deletions
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 @@
</sizepolicy>
</property>
<property name="text">
- <string>Dynamic pose resolution</string>
+ <string>Dynamic pose (for caps only, never clips)</string>
</property>
</widget>
</item>
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/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);
}
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)
{}
};
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)
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