From 456a922b5995f1f836c13c5795258bc83e521571 Mon Sep 17 00:00:00 2001 From: Stéphane Lenclud Date: Mon, 1 Apr 2019 20:18:02 +0200 Subject: Easy Tracker: Preview cross hair now showing top point. Deleting home made P3P solver we branched from pt now that our OpenCV solution is working. --- tracker-points/module/module.cpp | 4 ++-- tracker-points/module/point_extractor.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tracker-points/module') diff --git a/tracker-points/module/module.cpp b/tracker-points/module/module.cpp index 06cd003b..59e254ac 100644 --- a/tracker-points/module/module.cpp +++ b/tracker-points/module/module.cpp @@ -48,7 +48,7 @@ struct pt_module_traits final : pt_runtime_traits struct tracker_pt : Tracker_PT { - tracker_pt() : Tracker_PT(pointer(new pt_module_traits)) + tracker_pt() : EasyTracker(pointer(new pt_module_traits)) { } }; @@ -58,7 +58,7 @@ struct dialog_pt : TrackerDialog_PT dialog_pt(); }; -dialog_pt::dialog_pt() : TrackerDialog_PT(module_name) {} +dialog_pt::dialog_pt() : EasyTrackerDialog(module_name) {} QString metadata_pt::name() { return tr("Points Tracker 0.1"); } QIcon metadata_pt::icon() { return QIcon(":/Resources/Logo_IR.png"); } diff --git a/tracker-points/module/point_extractor.cpp b/tracker-points/module/point_extractor.cpp index d1975317..0d54a66b 100644 --- a/tracker-points/module/point_extractor.cpp +++ b/tracker-points/module/point_extractor.cpp @@ -7,7 +7,6 @@ */ #include "point_extractor.h" -#include "point_tracker.h" #include "frame.hpp" #include "cv/numeric.hpp" @@ -214,7 +213,7 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob cv::Point p(iround(b.pos[0] * cx * c_fract), iround(b.pos[1] * cy * c_fract)); - auto circle_color = k >= PointModel::N_POINTS + auto circle_color = k >= KPointCount ? cv::Scalar(192, 192, 192) : cv::Scalar(255, 255, 0); @@ -228,7 +227,7 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob buf[sizeof(buf)-1] = '\0'; std::snprintf(buf, sizeof(buf) - 1, "%.2fpx", (double)b.radius); - auto text_color = k >= PointModel::N_POINTS + auto text_color = k >= KPointCount ? cv::Scalar(160, 160, 160) : cv::Scalar(0, 0, 255); @@ -359,6 +358,7 @@ end: b.pos[1] = pos[1] + rect.y; } + // TODO: Do not do that if no preview. Delay blob drawing until we know where are the points? draw_blobs(preview_frame_.as()->mat, blobs.data(), blobs.size(), frame_gray.size()); -- cgit v1.2.3