diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-20 13:50:43 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-23 14:16:35 +0100 |
commit | 45e48310779c8adec67de7cf76328aa7bd034466 (patch) | |
tree | 40daded34f4c190e172964f1af47dc05566b2e5d /tracker-neuralnet/ftnoir_tracker_neuralnet.cpp | |
parent | 7b3af1e239b51e63a5956bc13e7528ad6e776689 (diff) |
tracker/nn: try fixing center on startup
Diffstat (limited to 'tracker-neuralnet/ftnoir_tracker_neuralnet.cpp')
-rw-r--r-- | tracker-neuralnet/ftnoir_tracker_neuralnet.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp index e9a490fa..d8077326 100644 --- a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp +++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp @@ -353,7 +353,7 @@ bool NeuralNetTracker::detect() last_pose_affine_ = pose_affine; } - draw_gizmos(*face, last_pose_affine_); + draw_gizmos(*face, pose_affine); return true; } @@ -652,12 +652,16 @@ void NeuralNetTracker::update_fps(double dt) void NeuralNetTracker::data(double *data) { - Affine tmp = [&]() + auto tmp2 = [&]() { QMutexLocker lck(&mtx_); return last_pose_affine_; }(); + if (!tmp2) + return; + const auto& tmp = *tmp2; + const auto& mx = tmp.R.col(0); const auto& my = tmp.R.col(1); const auto& mz = -tmp.R.col(2); @@ -682,7 +686,7 @@ void NeuralNetTracker::data(double *data) Affine NeuralNetTracker::pose() { QMutexLocker lck(&mtx_); - return last_pose_affine_; + return last_pose_affine_ ? *last_pose_affine_ : Affine{}; } std::tuple<cv::Size,double, double> NeuralNetTracker::stats() const |