summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/frame.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-12 19:40:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-12 19:40:22 +0100
commit537a88e522314753149e1ea7921489e58043b40c (patch)
treea62ac59a546c8b0ee8adeee3bd2aa255d7e4570e /tracker-pt/frame.hpp
parent11d8e48e4370c9201f8258b418aadc7a4290dba1 (diff)
tracker/pt: isolate point extractor and image type
Issue: #718
Diffstat (limited to 'tracker-pt/frame.hpp')
-rw-r--r--tracker-pt/frame.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tracker-pt/frame.hpp b/tracker-pt/frame.hpp
new file mode 100644
index 00000000..f8c33ebe
--- /dev/null
+++ b/tracker-pt/frame.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "pt-api.hpp"
+
+#include <opencv2/core.hpp>
+#include <QImage>
+
+namespace pt_module {
+
+struct Frame final : pt_frame
+{
+ cv::Mat mat;
+
+ operator const cv::Mat&() const& { return mat; }
+ operator cv::Mat&() & { return mat; }
+};
+
+struct Preview final : pt_preview
+{
+ Preview(int w, int h);
+
+ Preview& operator=(const pt_frame& frame) override;
+ QImage get_bitmap() override;
+ void draw_head_center(double x, double y) override;
+
+ operator cv::Mat&() { return frame_copy; }
+ operator cv::Mat const&() const { return frame_copy; }
+
+private:
+ static void ensure_size(cv::Mat& frame, int w, int h, int type);
+
+ bool fresh = true;
+ cv::Mat frame_copy, frame_color, frame_resize, frame_out;
+};
+
+} // ns pt_module