diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 06:58:45 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 06:58:45 +0200 |
commit | 3a66beb3da397c21c95fb46fd20cd56989541876 (patch) | |
tree | 917b3988053e9184773296c892ee84edf71ad6d2 | |
parent | 4f13435a9d1ca366afe7ec206ce9957980d58e88 (diff) |
pt: switch default calibration when used model changes
Sponsored-by: TrackHat
-rw-r--r-- | facetracknoir/wizard.cpp | 7 | ||||
-rw-r--r-- | ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 14 |
2 files changed, 14 insertions, 7 deletions
diff --git a/facetracknoir/wizard.cpp b/facetracknoir/wizard.cpp index bc90176a..e19a29c4 100644 --- a/facetracknoir/wizard.cpp +++ b/facetracknoir/wizard.cpp @@ -62,13 +62,6 @@ void Wizard::set_data() state.pose.save_mappings(); settings_pt pt; - switch (m) - { - default: - case Cap: pt.t_MH_x = 0; pt.t_MH_y = 0; pt.t_MH_z = 0; break; - case ClipRight: pt.t_MH_x = ClipRightX; pt.t_MH_y = 0; pt.t_MH_z = 0; break; - case ClipLeft: pt.t_MH_x = ClipLeftX; pt.t_MH_y = 0; pt.t_MH_z = 0; break; - } pt.threshold = 31; pt.min_point_size = 2; pt.max_point_size = 50; 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 |