From fbd961775001228f6ffd9cc3bf09aa2de610aeae Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 11 Jan 2018 19:03:10 +0100 Subject: tracker/pt: allow for reuse Issue: #718 This allows for replacing the camera and point extractor code. See `module.cpp' and `pt-api.hpp`. --- tracker-pt/point_extractor.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'tracker-pt/point_extractor.h') 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 @@ -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& 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& 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 blobs; -- cgit v1.2.3