diff options
Diffstat (limited to 'FTNoIR_Tracker_PT/point_tracker.cpp')
-rw-r--r-- | FTNoIR_Tracker_PT/point_tracker.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/FTNoIR_Tracker_PT/point_tracker.cpp b/FTNoIR_Tracker_PT/point_tracker.cpp index a881da62..cce327e9 100644 --- a/FTNoIR_Tracker_PT/point_tracker.cpp +++ b/FTNoIR_Tracker_PT/point_tracker.cpp @@ -91,7 +91,10 @@ PointTracker::PointTracker() dt_reset(1),
v_t(0,0,0),
v_r(0,0,0),
- dynamic_pose_resolution(true)
+ dynamic_pose_resolution(true),
+ fov(0),
+ _w(0),
+ _h(0)
{
}
@@ -141,7 +144,7 @@ bool PointTracker::track(const vector<Vec2f>& points, float fov, float dt, int w predict(dt_valid);
// if there is a point correspondence problem something has gone wrong, do a reset
- if (!find_correspondences(points, fov, w, h))
+ if (!find_correspondences(points))
{
//qDebug()<<"Error in finding point correspondences!";
X_CM = X_CM_old; // undo prediction
@@ -178,7 +181,7 @@ void PointTracker::update_velocities(float dt) v_t = (X_CM.t - X_CM_old.t)/dt;
}
-bool PointTracker::find_correspondences(const vector<Vec2f>& points, float fov, int w, int h)
+bool PointTracker::find_correspondences(const vector<Vec2f>& points)
{
if (init_phase) {
// We do a simple freetrack-like sorting in the init phase...
@@ -195,9 +198,9 @@ bool PointTracker::find_correspondences(const vector<Vec2f>& points, float fov, else {
// ... otherwise we look at the distance to the projection of the expected model points
// project model points under current pose
- p_exp[0] = project(Vec3f(0,0,0), fov, w, h);
- p_exp[1] = project(point_model->M01, fov, w, h);
- p_exp[2] = project(point_model->M02, fov, w, h);
+ p_exp[0] = project(Vec3f(0,0,0));
+ p_exp[1] = project(point_model->M01);
+ p_exp[2] = project(point_model->M02);
// set correspondences by minimum distance to projected model point
bool point_taken[PointModel::N_POINTS];
@@ -233,6 +236,10 @@ bool PointTracker::find_correspondences(const vector<Vec2f>& points, float fov, void PointTracker::POSIT(float fov, int w, int h)
{
+ // XXX hack
+ this->fov = fov;
+ _w = w;
+ _h = h;
std::vector<cv::Point3f> obj_points;
std::vector<cv::Point2f> img_points;
|