diff options
author | Patrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb> | 2013-01-13 11:10:44 +0000 |
---|---|---|
committer | Patrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb> | 2013-01-13 11:10:44 +0000 |
commit | 9f7fd1d155128e1d382654d9de1c72f19006e856 (patch) | |
tree | 56aa35ed7440625ad5820bc904da77cffd50088b /FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | |
parent | 5fd06c5d0a28a861e02f000d95cf82d987465041 (diff) |
PT: Camera pitch correction for translation, prepared GUI for release
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@208 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp')
-rw-r--r-- | FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp index e9394eff..5b77da69 100644 --- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp @@ -201,7 +201,14 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) FrameTrafo X_CH = X_CM * X_MH;
Matx33f R = X_CH.R * X_CH_0.R.t();
- Vec3f t = X_CH.t - X_CH_0.t;
+ Vec3f t = X_CH.t - X_CH_0.t;
+
+ // correct for camera pitch
+ Matx33f R_CP( 1, 0, 0,
+ 0, cos(deg2rad*cam_pitch), sin(deg2rad*cam_pitch),
+ 0, -sin(deg2rad*cam_pitch), cos(deg2rad*cam_pitch));
+ R = R_CP * R * R_CP.t();
+ t = R_CP * t;
// get translation(s)
if (bEnableX) {
@@ -213,12 +220,6 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data) if (bEnableZ) {
data->z = t[2] / 10.0;
}
-
- // correct for camera pitch
- Matx33f R_CP( 1, 0, 0,
- 0, cos(deg2rad*cam_pitch), sin(deg2rad*cam_pitch),
- 0, -sin(deg2rad*cam_pitch), cos(deg2rad*cam_pitch));
- R = R_CP * R * R_CP.t();
// translate rotation matrix from opengl (G) to roll-pitch-yaw (R) frame
// -z -> x, y -> z, x -> -y
|