diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-21 20:00:09 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-21 20:17:14 +0200 |
commit | 9366de846d8c6e9c14f0dea0d668672dc4293e05 (patch) | |
tree | ed00a8526276eaeb4142fd3acfbb6b27806e9705 | |
parent | fecc9ce79ccffdb5899de59404c09b5409e5eaab (diff) |
tracker/pt: fix cross location formula
-rwxr-xr-x | tracker-pt/ftnoir_tracker_pt.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 562ffcf1..8b0075d1 100755 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -144,19 +144,23 @@ void Tracker_PT::run() Affine X_CM = pose(); - std::function<void(const cv::Vec2d&, const cv::Scalar&)> fun = [&](const cv::Vec2d& p, const cv::Scalar& color) + auto fun = [&](const cv::Vec2d& p, const cv::Scalar& color) { - cv::Point p2(int(p[0]) * frame_.cols + frame_.cols/2, -int(p[1]) * frame_.cols + frame_.rows/2); + using std::round; + + cv::Point p2(round(p[0] * frame_.cols + frame_.cols/2), + round(-p[1] * frame_.cols + frame_.rows/2)); + cv::line(frame_, cv::Point(p2.x - 20, p2.y), cv::Point(p2.x + 20, p2.y), color, - 4); + 2); cv::line(frame_, cv::Point(p2.x, p2.y - 20), cv::Point(p2.x, p2.y + 20), color, - 4); + 2); }; for (unsigned i = 0; i < points.size(); i++) |