From 4c95700fc6848d46a33b565df7eb81ada2b32987 Mon Sep 17 00:00:00 2001 From: Patrick Ruoff Date: Mon, 31 Dec 2012 12:33:18 +0000 Subject: Updated PointTracker git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@200 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Tracker_PT/point_tracker.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'FTNoIR_Tracker_PT/point_tracker.h') diff --git a/FTNoIR_Tracker_PT/point_tracker.h b/FTNoIR_Tracker_PT/point_tracker.h index ca222a3b..efd40424 100644 --- a/FTNoIR_Tracker_PT/point_tracker.h +++ b/FTNoIR_Tracker_PT/point_tracker.h @@ -77,15 +77,36 @@ public: bool track(const std::vector& points, float f, float dt); boost::shared_ptr point_model; + float dt_reset; + FrameTrafo get_pose() const { return X_CM; } + void reset(); protected: - bool find_correspondences(const std::vector& points); + inline cv::Vec2f project(const cv::Vec3f& v_M, float f) + { + cv::Vec3f v_C = X_CM * v_M; + return cv::Vec2f(f*v_C[0]/v_C[2], f*v_C[1]/v_C[2]); + } + + bool find_correspondences(const std::vector& points, float f); + cv::Vec2f p[PointModel::N_POINTS]; // the points in model order + cv::Vec2f p_exp[PointModel::N_POINTS]; // the expected point positions + + void predict(float dt); + void update_velocities(float dt); + void reset_velocities(); - void POSIT(float f); + + int POSIT(float f); // The POSIT algorithm, returns the number of iterations + bool init_phase; + float dt_valid; // time since last valid tracking result + cv::Vec3f v_t; // velocities + cv::Vec3f v_r; FrameTrafo X_CM; // trafo from model to camera + FrameTrafo X_CM_old; }; #endif //POINTTRACKER_H -- cgit v1.2.3