diff options
author | Stanisław Halik <sthalik@misaki.pl> | 2018-01-26 16:28:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-26 16:28:06 +0100 |
commit | 86e112dd54202bed6880933804a89e1fd62f7d51 (patch) | |
tree | bd375c924fa72f9eb3ce1d78356785077836f3c1 /tracker-wii/wii_point_extractor.h | |
parent | 19eca40d3f057868f49d3285683e4a32b03b9385 (diff) | |
parent | 4a2a1b636df7a67722b6b5764efa8cfc63c6a5e1 (diff) |
Merge pull request #738 from cpuwolf/wii3-rebase
tracker/wii: relocation & fix fov & code clean-up
Diffstat (limited to 'tracker-wii/wii_point_extractor.h')
-rw-r--r-- | tracker-wii/wii_point_extractor.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tracker-wii/wii_point_extractor.h b/tracker-wii/wii_point_extractor.h new file mode 100644 index 00000000..be0e5f45 --- /dev/null +++ b/tracker-wii/wii_point_extractor.h @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2017-2018 Wei Shuai <cpuwolf@gmail.com> +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +*/ +#pragma once + +#include "pt-api.hpp" + +#include <vector> + +#include <opencv2/core.hpp> +#include <opencv2/imgproc.hpp> + +namespace pt_module { + +using namespace types; + +class WIIPointExtractor 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 pt_frame& frame, pt_preview& preview_frame, std::vector<vec2>& points) override; + WIIPointExtractor(const QString& module_name); +private: + static constexpr int max_blobs = 16; + + pt_settings s; + void _draw_point(cv::Mat& preview_frame, const vec2& p, const cv::Scalar& color, int thinkness = 1); + bool _draw_points(cv::Mat& preview_frame, const struct wii_info &wii, std::vector<vec2>& points); + void _draw_bg(cv::Mat& preview_frame, const struct wii_info &wii); +}; + +} // ns impl + |