From c057fc0acfccb5772514cebd82a9a6337ca8c231 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 12 Jan 2014 19:50:07 +0100 Subject: pt: display points' centers --- FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp') diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp index 53d9c9e4..39825168 100644 --- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp +++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp @@ -82,7 +82,22 @@ void Tracker::run() if (new_frame && !frame.empty()) { frame = frame_rotation.rotate_frame(frame); - const std::vector& points = point_extractor.extract_points(frame, dt, false); + const std::vector& points = point_extractor.extract_points(frame, dt, true); + for (auto p : points) + { + auto p2 = cv::Point(p[0] * frame.cols + frame.cols/2, -p[1] * frame.cols + frame.rows/2); + cv::Scalar color(0, 255, 0); + cv::line(frame, + cv::Point(p2.x - 20, p2.y), + cv::Point(p2.x + 20, p2.y), + color, + 4); + cv::line(frame, + cv::Point(p2.x, p2.y - 20), + cv::Point(p2.x, p2.y + 20), + color, + 4); + } tracking_valid = point_tracker.track(points, camera.get_info().f, dt); video_widget->update_image(frame); } -- cgit v1.2.3