diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-01-05 21:53:57 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-01-05 21:53:57 +0100 |
commit | d62fe231f17ba508b35243a6891ac999791343f1 (patch) | |
tree | 8942125aef36281f690862a201ec00d242ef0e52 | |
parent | 089a2f319f90aa1f447126b964404c327f9645bb (diff) |
copy centering code from 2.2
Issue: #106
Signs of XYZ are the same, it turns out. It's the display value
that needs adjusting. Tested on @FlyingCircus- video.
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 8 | ||||
-rw-r--r-- | ftnoir_tracker_pt/trans_calib.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 26550bad..c26af007 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -80,8 +80,8 @@ void Tracker::run() point_tracker.track(points, PointModel(s), get_focal_length()); { - cv::Vec3f MH(s.t_MH_x, s.t_MH_y, s.t_MH_z); Affine CM = pose(); + cv::Vec3f MH(-s.t_MH_x, s.t_MH_y, s.t_MH_z); cv::Vec3f p = CM.t - MH; float fx = get_focal_length(); cv::Vec2f p_(p[0] / p[2] * fx, p[1] / p[2] * fx); @@ -161,11 +161,11 @@ void Tracker::data(THeadPoseData *data) Affine X_CM = point_tracker.pose(); - Affine X_MH(Matx33f::eye(), cv::Vec3f(-s.t_MH_x, s.t_MH_y, s.t_MH_z)); + Affine X_MH(Matx33f::eye(), cv::Vec3f(s.t_MH_x, s.t_MH_y, s.t_MH_z)); Affine X_GH = X_CM * X_MH; - Matx33f R = X_GH.R; - Vec3f t = X_GH.t; + Matx33f R = X_GH.R * X_MH.R.t(); + Vec3f t = X_GH.t - X_MH.t; // translate rotation matrix from opengl (G) to roll-pitch-yaw (E) frame // -z -> x, y -> z, x -> -y diff --git a/ftnoir_tracker_pt/trans_calib.cpp b/ftnoir_tracker_pt/trans_calib.cpp index e6a56e36..2994eb48 100644 --- a/ftnoir_tracker_pt/trans_calib.cpp +++ b/ftnoir_tracker_pt/trans_calib.cpp @@ -40,5 +40,5 @@ void TranslationCalibrator::update(const Matx33f& R_CM_k, const Vec3f& t_CM_k) Vec3f TranslationCalibrator::get_estimate() { Vec6f x = P.inv() * y; - return Vec3f(x[0], -x[1], -x[2]); + return Vec3f(-x[0], -x[1], -x[2]); } |