From 9da39ce65e42097b5f05eed2ce2cd40cf234ef73 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 20 Sep 2016 23:08:10 +0200 Subject: tracker/pt: merge from unstable - the pose estimator doesn't need locking at all - only return point count to the dialog, reducing locking - allow for only 8 pixels difference between consecutive dynamic pose frames at 640x480, half that at 320x240 - extract points taking in account pixel brightness, not merely contours - in case of more than three points, prefer the brightest ones scoring on radius and average pixel brightness --- tracker-pt/point_tracker.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tracker-pt/point_tracker.h') diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index 00e9278c..77c07125 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -15,7 +15,6 @@ #include "ftnoir_tracker_pt_settings.h" #include -#include class Affine { @@ -118,9 +117,9 @@ public: // track the pose using the set of normalized point coordinates (x pos in range -0.5:0.5) // f : (focal length)/(sensor width) // dt : time since last call - void track(const std::vector& projected_points, const PointModel& model, float f, bool dynamic_pose, int init_phase_timeout); - Affine pose() { QMutexLocker l(&mtx); return X_CM; } - cv::Vec2f project(const cv::Vec3f& v_M, float f); + void track(const std::vector& projected_points, const PointModel& model, double focal_length, bool dynamic_pose, int init_phase_timeout, int w, int h); + Affine pose() { return X_CM; } + cv::Vec2d project(const cv::Vec3d& v_M, double focal_length); private: // the points in model order struct PointOrder @@ -133,15 +132,14 @@ private: } }; - PointOrder find_correspondences_previous(const std::vector& points, const PointModel &model, float f); PointOrder find_correspondences(const std::vector& projected_points, const PointModel &model); + PointOrder find_correspondences_previous(const std::vector& points, const PointModel &model, double focal_length, int w, int h); bool POSIT(const PointModel& point_model, const PointOrder& order, double focal_length); // The POSIT algorithm, returns the number of iterations Affine X_CM; // trafo from model to camera Timer t; bool init_phase; - QMutex mtx; }; #endif //POINTTRACKER_H -- cgit v1.2.3