summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.cpp')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index 252a7456..8c478824 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -72,7 +72,7 @@ float Tracker_PT::get_focal_length()
const int w = info.res_x, h = info.res_y;
const double diag = sqrt(w * w + h * h)/w;
const double fov = 2.*atan(tan(diag_fov/2.0)/sqrt(1. + diag*diag));
- return w*.5 / tan(.5 * fov);
+ return .5 / tan(.5 * fov);
}
void Tracker_PT::run()
@@ -125,17 +125,18 @@ void Tracker_PT::run()
for (unsigned i = 0; i < points.size(); i++)
{
auto& p = points[i];
+ auto p2 = cv::Point(p[0] * frame.cols + frame.cols/2, -p[1] * frame.cols + frame.rows/2);
cv::Scalar color(0, 255, 0);
if (i == points.size()-1)
color = cv::Scalar(0, 0, 255);
cv::line(frame,
- cv::Point(p[0] - 20, p[1]),
- cv::Point(p[0] + 20, p[1]),
+ cv::Point(p2.x - 20, p2.y),
+ cv::Point(p2.x + 20, p2.y),
color,
4);
cv::line(frame,
- cv::Point(p[0], p[1] - 20),
- cv::Point(p[0], p[1] + 20),
+ cv::Point(p2.x, p2.y - 20),
+ cv::Point(p2.x, p2.y + 20),
color,
4);
}