summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-02 06:58:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-02 06:58:45 +0200
commit3a66beb3da397c21c95fb46fd20cd56989541876 (patch)
tree917b3988053e9184773296c892ee84edf71ad6d2 /ftnoir_tracker_pt
parent4f13435a9d1ca366afe7ec206ce9957980d58e88 (diff)
pt: switch default calibration when used model changes
Sponsored-by: TrackHat
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index 04f1b8d9..7b70d4eb 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -126,6 +126,20 @@ void Tracker_PT::run()
{
Affine X_CM = pose();
Affine X_MH(cv::Matx33f::eye(), cv::Vec3f(s.t_MH_x, s.t_MH_y, s.t_MH_z)); // just copy pasted these lines from below
+ if (X_MH.t[0] == 0 && X_MH.t[1] == 0 && X_MH.t[2] == 0)
+ {
+ int m = s.model_used;
+ switch (m)
+ {
+ default:
+ // cap
+ case 0: X_MH.t[0] = 0; X_MH.t[1] = 0; X_MH.t[2] = 0; break;
+ // clip
+ case 1: X_MH.t[0] = 135; X_MH.t[1] = 0; X_MH.t[2] = 0; break;
+ // left clip
+ case 2: X_MH.t[0] = -135; X_MH.t[1] = 0; X_MH.t[2] = 0; break;
+ }
+ }
Affine X_GH = X_CM * X_MH;
cv::Vec3f p = X_GH.t; // head (center?) position in global space
cv::Vec2f p_(p[0] / p[2] * fx, p[1] / p[2] * fx); // projected to screen