summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point_extractor.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-11 19:03:10 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-11 19:03:10 +0100
commitfbd961775001228f6ffd9cc3bf09aa2de610aeae (patch)
treeb54c35357ea0ec0fbf2d78d14a17bcf4047c9488 /tracker-pt/point_extractor.h
parent71374d0b5cd456e25252775fdec89fe3cf2aa5e6 (diff)
tracker/pt: allow for reuse
Issue: #718 This allows for replacing the camera and point extractor code. See `module.cpp' and `pt-api.hpp`.
Diffstat (limited to 'tracker-pt/point_extractor.h')
-rw-r--r--tracker-pt/point_extractor.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/tracker-pt/point_extractor.h b/tracker-pt/point_extractor.h
index d31304b9..266964e5 100644
--- a/tracker-pt/point_extractor.h
+++ b/tracker-pt/point_extractor.h
@@ -8,9 +8,7 @@
#pragma once
-#include "ftnoir_tracker_pt_settings.h"
-#include "camera.h"
-#include "cv/numeric.hpp"
+#include "pt-api.hpp"
#include <vector>
@@ -27,23 +25,21 @@ struct blob
vec2 pos;
cv::Rect rect;
- blob(f radius, const vec2& pos, f brightness, cv::Rect &rect);
+ blob(f radius, const vec2& pos, f brightness, const cv::Rect& rect);
};
-class PointExtractor final
+class PointExtractor final : public pt_point_extractor
{
public:
// extracts points from frame and draws some processing info into frame, if draw_output is set
// dt: time since last call in seconds
- void extract_points(const cv::Mat& frame, cv::Mat& preview_frame, std::vector<vec2>& points);
- PointExtractor();
-
- settings_pt s;
-
- static double threshold_radius_value(int w, int h, int threshold);
+ void extract_points(const cv::Mat& frame, cv::Mat& preview_frame, std::vector<vec2>& points) override;
+ PointExtractor(const QString& module_name);
private:
static constexpr int max_blobs = 16;
+ pt_settings s;
+
cv::Mat1b frame_gray, frame_bin, frame_blobs;
cv::Mat1f hist;
std::vector<blob> blobs;