summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT/point_tracker.h
diff options
context:
space:
mode:
authorPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2012-12-31 12:33:18 +0000
committerPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2012-12-31 12:33:18 +0000
commit4c95700fc6848d46a33b565df7eb81ada2b32987 (patch)
treea0f13e7a70f2e22516b9fae6177e7e8b7af269fe /FTNoIR_Tracker_PT/point_tracker.h
parent977f25772f449e79089059820453bb7499ff4d35 (diff)
Updated PointTracker
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@200 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Tracker_PT/point_tracker.h')
-rw-r--r--FTNoIR_Tracker_PT/point_tracker.h25
1 files changed, 23 insertions, 2 deletions
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<cv::Vec2f>& points, float f, float dt);
boost::shared_ptr<PointModel> point_model;
+ float dt_reset;
+
FrameTrafo get_pose() const { return X_CM; }
+ void reset();
protected:
- bool find_correspondences(const std::vector<cv::Vec2f>& 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<cv::Vec2f>& 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