diff options
Diffstat (limited to 'tracker-pt/point_tracker.h')
-rw-r--r-- | tracker-pt/point_tracker.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index 095b79d2..6f3e0cee 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -28,11 +28,11 @@ namespace pt_module { // nomenclature as in // [Denis Oberkampf, Daniel F. DeMenthon, Larry S. Davis: "Iterative Pose Estimation Using Coplanar Feature Points"] -using namespace types; +using namespace numeric_types; struct PointModel final { - static constexpr inline unsigned N_POINTS = 3; + static constexpr unsigned N_POINTS = 3; vec3 M01; // M01 in model frame vec3 M02; // M02 in model frame @@ -61,7 +61,7 @@ public: // f : (focal length)/(sensor width) // dt : time since last call void track(const std::vector<vec2>& projected_points, const PointModel& model, const pt_camera_info& info, int init_phase_timeout); - Affine pose() { return X_CM; } + Affine pose() const { 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); void reset_state(); @@ -70,17 +70,16 @@ private: // the points in model order using PointOrder = std::array<vec2, 3>; - bool maybe_use_old_point_order(const PointOrder& order, const pt_camera_info& info); - PointOrder find_correspondences(const vec2* projected_points, const PointModel &model); PointOrder find_correspondences_previous(const vec2* points, const PointModel &model, const pt_camera_info& info); // The POSIT algorithm, returns the number of iterations int POSIT(const PointModel& point_model, const PointOrder& order, f focal_length); - Affine X_CM; // transform from model to camera - PointOrder prev_order, prev_scaled_order; + Affine X_CM; // transform from model to camera + Affine X_CM_expected; + PointOrder prev_positions; Timer t; - bool init_phase = true, prev_order_valid = false; + bool init_phase = true; }; } // ns pt_module |