summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-01-05 21:53:57 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-01-05 21:53:57 +0100
commitd62fe231f17ba508b35243a6891ac999791343f1 (patch)
tree8942125aef36281f690862a201ec00d242ef0e52 /ftnoir_tracker_pt
parent089a2f319f90aa1f447126b964404c327f9645bb (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.
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp8
-rw-r--r--ftnoir_tracker_pt/trans_calib.cpp2
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]);
}