diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-16 11:54:21 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-12-16 11:54:21 +0100 |
commit | 4d62adf8bc4f78f8dca8196c7f52a6a44cc5829a (patch) | |
tree | 8b07b851c334ed80054d53e11ab1f9258c76bc02 /tracker-pt/point_tracker.h | |
parent | fc24671937724beb3fde6c6edfc1c124fbb0ef75 (diff) |
tracker/pt: refactor camera info handling
- Pass `struct CamInfo' rather than several elements separately
- Reformat
- Return `struct CamInfo' together with the frame since then it's always valid
- Move the focal length formula into `struct CamInfo'
- Remove incorrect focal length formula rather than #if 0
- Pass some stuff by reference and not by pointer
Diffstat (limited to 'tracker-pt/point_tracker.h')
-rw-r--r-- | tracker-pt/point_tracker.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index 0bac05ab..63caf0dd 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -11,6 +11,7 @@ #include "ftnoir_tracker_pt_settings.h" #include "affine.hpp" #include "numeric.hpp" +#include "camera.h" #include <opencv2/core.hpp> #include <cstddef> @@ -57,7 +58,7 @@ 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<vec2>& projected_points, const PointModel& model, f focal_length, bool dynamic_pose, int init_phase_timeout, int w, int h); + void track(const std::vector<vec2>& projected_points, const PointModel& model, const CamInfo& info, int init_phase_timeout); Affine pose() { return X_CM; } vec2 project(const vec3& v_M, f focal_length); vec2 project(const vec3& v_M, f focal_length, const Affine& X_CM); @@ -67,7 +68,7 @@ private: using PointOrder = std::array<vec2, 3>; PointOrder find_correspondences(const vec2* projected_points, const PointModel &model); - PointOrder find_correspondences_previous(const vec2* points, const PointModel &model, f focal_length, int w, int h); + PointOrder find_correspondences_previous(const vec2* points, const PointModel &model, const CamInfo& info); int POSIT(const PointModel& point_model, const PointOrder& order, f focal_length); // The POSIT algorithm, returns the number of iterations Affine X_CM; // trafo from model to camera |