summaryrefslogtreecommitdiffhomepage
path: root/tracker-points/module
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-04-01 20:18:02 +0200
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commit456a922b5995f1f836c13c5795258bc83e521571 (patch)
tree688b70cea01ad5abaf16a62f9c121f5b17086918 /tracker-points/module
parenteb77f73826a26ad1dea84e3ea0173bb952a46e26 (diff)
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.
Diffstat (limited to 'tracker-points/module')
-rw-r--r--tracker-points/module/module.cpp4
-rw-r--r--tracker-points/module/point_extractor.cpp6
2 files changed, 5 insertions, 5 deletions
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<pt_runtime_traits>(new pt_module_traits))
+ tracker_pt() : EasyTracker(pointer<pt_runtime_traits>(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<Frame>()->mat,
blobs.data(), blobs.size(),
frame_gray.size());