diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-11 19:03:10 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-11 19:03:10 +0100 |
commit | fbd961775001228f6ffd9cc3bf09aa2de610aeae (patch) | |
tree | b54c35357ea0ec0fbf2d78d14a17bcf4047c9488 /tracker-pt/ftnoir_tracker_pt.h | |
parent | 71374d0b5cd456e25252775fdec89fe3cf2aa5e6 (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/ftnoir_tracker_pt.h')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index 8274d62e..9cf14cfd 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -9,12 +9,10 @@ #pragma once #include "api/plugin-api.hpp" -#include "ftnoir_tracker_pt_settings.h" #include "cv/numeric.hpp" -#include "camera.h" -#include "point_extractor.h" +#include "pt-api.hpp" #include "point_tracker.h" #include "cv/video-widget.hpp" #include "compat/util.hpp" @@ -25,17 +23,13 @@ #include <opencv2/core.hpp> -#include <QCoreApplication> #include <QThread> #include <QMutex> -#include <QMutexLocker> -#include <QTime> #include <QLayout> -#include <QSize> class TrackerDialog_PT; -namespace impl { +namespace pt_impl { using namespace types; @@ -43,11 +37,10 @@ class Tracker_PT : public QThread, public ITracker { Q_OBJECT - friend class camera_dialog; friend class ::TrackerDialog_PT; public: - Tracker_PT(); + Tracker_PT(const pt_runtime_traits& pt_runtime_traits); ~Tracker_PT() override; module_status start_tracker(QFrame* parent_window) override; void data(double* data) override; @@ -55,7 +48,7 @@ public: Affine pose(); int get_n_points(); - bool get_cam_info(CamInfo* info); + bool get_cam_info(pt_camera_info* info); public slots: void maybe_reopen_camera(); void set_fov(int value); @@ -64,15 +57,16 @@ protected: private: QMutex camera_mtx; QMutex data_mtx; - Camera camera; - PointExtractor point_extractor; - PointTracker point_tracker; + std::unique_ptr<pt_point_extractor> point_extractor; + std::unique_ptr<pt_camera> camera; + PointTracker point_tracker; + + pt_settings s; std::unique_ptr<cv_video_widget> video_widget; std::unique_ptr<QLayout> layout; - settings_pt s; cv::Mat frame, preview_frame; std::vector<vec2> points; @@ -85,12 +79,6 @@ private: //static constexpr float deg2rad = float(M_PI/180); }; -} // ns impl - -class PT_metadata : public Metadata -{ - QString name() { return otr_tr("PointTracker 1.1"); } - QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); } -}; +} // ns pt_impl -using impl::Tracker_PT; +using pt_impl::Tracker_PT; |