From 8a87e1a658f04eaffa10da30f019a64902f8d917 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 28 Nov 2014 23:21:12 +0100 Subject: fit line using basic arithmetic Issue: #98 --- ftnoir_tracker_pt/point_tracker.cpp | 14 +++++++------- ftnoir_tracker_pt/point_tracker.h | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'ftnoir_tracker_pt') diff --git a/ftnoir_tracker_pt/point_tracker.cpp b/ftnoir_tracker_pt/point_tracker.cpp index 640d4528..3b1a49e2 100644 --- a/ftnoir_tracker_pt/point_tracker.cpp +++ b/ftnoir_tracker_pt/point_tracker.cpp @@ -6,7 +6,6 @@ */ #include "point_tracker.h" -#include #include #include @@ -52,10 +51,6 @@ PointModel::PointModel(Vec3f M01, Vec3f M02) float s12 = M01.dot(M02); float s22 = M02.dot(M02); P = 1.0/(s11*s22-s12*s12) * Matx22f(s22, -s12, -s12, s11); - - cv::Vec6f line; - cv::fitLine(std::vector{M01, M02}, line, CV_DIST_L1, 0, 1e-2, 1e-4); - d = cv::Vec3f(line[0], line[1], line[3]); } #ifdef OPENTRACK_API @@ -106,9 +101,14 @@ PointTracker::PointOrder PointTracker::find_correspondences(const std::vector{ Vec3f{0,0,0}, model.M01, model.M02 }, model_d_order, model.d); + model.get_d_order(std::vector{ Vec3f{0,0,0}, model.M01, model.M02 }, + model_d_order, + cv::Vec3f(model.M01[0]-model.M02[0], + model.M01[1]-model.M02[1], + model.M01[2]-model.M02[2])); // set correspondences PointOrder p; for (int i=0; i void get_d_order(const std::vector& points, int* d_order, vec d) const; -- cgit v1.2.3