summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-12 23:29:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-12 23:29:18 +0200
commitcbd441a670a4447d607d276dc604fae8a5928e3d (patch)
tree6bff8da9eb2014bf9d06c48cbc76e15dfd4a7b9c /tracker-pt/ftnoir_tracker_pt.cpp
parentf5770a675ec0a716fb5f0350f4ff48f17f252105 (diff)
tracker/pt: cleanup
Also, changing "f" typedef to "float" won't break the build anymore.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 2862efdb..0b012a5e 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -78,7 +78,7 @@ void Tracker_PT::run()
point_extractor.extract_points(frame, preview_frame, points);
point_count = points.size();
- f fx;
+ double fx;
cam_info.get_focal_length(fx);
const bool success = points.size() >= PointModel::N_POINTS;
@@ -91,6 +91,8 @@ void Tracker_PT::run()
s.dynamic_pose ? s.init_phase_timeout : 0);
ever_success = true;
}
+ else
+ point_tracker.invalidate_pose();
{
Affine X_CM;
@@ -102,7 +104,7 @@ void Tracker_PT::run()
Affine X_MH(mat33::eye(), vec3(s.t_MH_x, s.t_MH_y, s.t_MH_z)); // just copy pasted these lines from below
Affine X_GH = X_CM * X_MH;
vec3 p = X_GH.t; // head (center?) position in global space
- vec2 p_(p[0] / p[2] * fx, p[1] / p[2] * fx); // projected to screen
+ vec2 p_((p[0] * fx) / p[2], (p[1] * fx) / p[2]); // projected to screen
static constexpr int len = 9;