summaryrefslogtreecommitdiffhomepage
path: root/tracker-points/module/frame.hpp
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-03-27 21:18:39 +0100
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commitb0e22e955d566b2a981cb43ae477f2646c0c978d (patch)
treec895caf17f673ae8c45ce9984400bbb0e712ec0c /tracker-points/module/frame.hpp
parent4017bc6534c1c52ad950589d758a3ff30d78f280 (diff)
Create Points Tracker based on original Point Tracker.
Diffstat (limited to 'tracker-points/module/frame.hpp')
-rw-r--r--tracker-points/module/frame.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/tracker-points/module/frame.hpp b/tracker-points/module/frame.hpp
new file mode 100644
index 00000000..89334599
--- /dev/null
+++ b/tracker-points/module/frame.hpp
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "pt-api.hpp"
+
+#include <opencv2/core.hpp>
+#include <QImage>
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wweak-vtables"
+#endif
+
+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(f x, f 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);
+
+ cv::Mat frame_copy, frame_out;
+};
+
+} // ns pt_module
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif