summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-12-20 23:29:03 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-12-20 23:29:03 +0100
commit5996bd4e9a567a73882d12ad7a6708f93b06bb69 (patch)
treeeccb0680fc1dc081fee2e5870a27011d8d724a83
parent7f82af417e6941148c36b8e01f342f9390c57dfa (diff)
pt: fix d_order logic
Issue: #107
-rw-r--r--ftnoir_tracker_pt/point_tracker.cpp12
-rw-r--r--ftnoir_tracker_pt/point_tracker.h3
2 files changed, 6 insertions, 9 deletions
diff --git a/ftnoir_tracker_pt/point_tracker.cpp b/ftnoir_tracker_pt/point_tracker.cpp
index 7a9fe645..eeb689ce 100644
--- a/ftnoir_tracker_pt/point_tracker.cpp
+++ b/ftnoir_tracker_pt/point_tracker.cpp
@@ -40,8 +40,7 @@ static bool d_vals_sort(const pair<float,int> a, const pair<float,int> b)
}
#endif
-template<typename vec>
-void PointModel::get_d_order(const std::vector<vec>& points, int d_order[], vec d) const
+void PointModel::get_d_order(const std::vector<cv::Vec2f>& points, int d_order[], cv::Vec2f d) const
{
// fit line to orthographically projected points
vector< pair<float,int> > d_vals;
@@ -80,17 +79,16 @@ PointTracker::PointOrder PointTracker::find_correspondences(const std::vector<cv
// sort points
int point_d_order[PointModel::N_POINTS];
int model_d_order[PointModel::N_POINTS];
- model.get_d_order(points, point_d_order,
- cv::Vec2f(points[0][0]-points[1][0], points[0][1]-points[1][1]));
+ cv::Vec2f d(points[0][0]-points[1][0], points[0][1]-points[1][1]);
+ model.get_d_order(points, point_d_order, d);
// calculate d and d_order for simple freetrack-like point correspondence
- model.get_d_order(std::vector<cv::Vec2f>{
+ model.get_d_order(std::vector<cv::Vec2f> {
Vec2f{0,0},
Vec2f(model.M01[0], model.M01[1]),
Vec2f(model.M02[0], model.M02[1])
},
model_d_order,
- cv::Vec2f(model.M01[0]-model.M02[0],
- model.M01[1]-model.M02[1]));
+ d);
// set correspondences
PointOrder p;
for (int i=0; i<PointModel::N_POINTS; ++i)
diff --git a/ftnoir_tracker_pt/point_tracker.h b/ftnoir_tracker_pt/point_tracker.h
index 83c7dc00..61d2a826 100644
--- a/ftnoir_tracker_pt/point_tracker.h
+++ b/ftnoir_tracker_pt/point_tracker.h
@@ -105,8 +105,7 @@ public:
}
}
- template<typename vec>
- void get_d_order(const std::vector<vec>& points, int* d_order, vec d) const;
+ void get_d_order(const std::vector<cv::Vec2f>& points, int* d_order, cv::Vec2f d) const;
};
// ----------------------------------------------------------------------------