summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-18 19:57:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-18 19:57:42 +0100
commit8a60f1c9613d396b50aa6adec4b1f5ffdb9e9806 (patch)
tree7c92080112cfbcd0383fb3ff304abefa19a13379 /tracker-pt/ftnoir_tracker_pt.cpp
parent84fb0aab5633a98fd2aef7d9e642628e826e2a9d (diff)
tracker/pt: reduce mutex contention
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 877b58fd..80227a39 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -19,8 +19,7 @@
//-----------------------------------------------------------------------------
Tracker_PT::Tracker_PT()
- : mutex(QMutex::Recursive),
- commands(0),
+ : commands(0),
video_widget(NULL),
video_frame(NULL),
ever_success(false)
@@ -94,29 +93,26 @@ void Tracker_PT::run()
if (new_frame && !frame.empty())
{
- QMutexLocker lock(&mutex);
-
std::vector<cv::Vec2f> points = point_extractor.extract_points(frame);
// blobs are sorted in order of circularity
if (points.size() > PointModel::N_POINTS)
points.resize(PointModel::N_POINTS);
- bool success = points.size() == PointModel::N_POINTS;
-
float fx;
if (!get_focal_length(fx))
continue;
+
+ const bool success = points.size() == PointModel::N_POINTS;
if (success)
{
point_tracker.track(points, PointModel(s), fx, s.dynamic_pose, s.init_phase_timeout);
+ ever_success = true;
}
Affine X_CM = pose();
- ever_success |= success;
-
{
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
Affine X_GH = X_CM * X_MH;