diff options
author | Wei Shuai <cpuwolf@gmail.com> | 2018-01-15 17:08:48 +0800 |
---|---|---|
committer | Wei Shuai <cpuwolf@gmail.com> | 2018-01-20 07:21:34 +0800 |
commit | 911e9deb712bafb5f622e215e286744696e90617 (patch) | |
tree | 9b6d365566a8a9934bb7b5dce7b924aa0bc8bbf4 /tracker-pt/tracker-wii/wii_point_extractor.h | |
parent | c49530ad99720fa638191db667610542bec3c696 (diff) |
add Wiimote supporting in point tracker
1. extrack point from wii frame
2. wii_camera outputs wii raw data, wii_extractor create preview
3. wiimote fov is about 42 degree
4. wii:change block functions to non-block function
"contains WiiYourself! wiimote code by gl.tter
http://gl.tter.org"
Diffstat (limited to 'tracker-pt/tracker-wii/wii_point_extractor.h')
-rw-r--r-- | tracker-pt/tracker-wii/wii_point_extractor.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tracker-pt/tracker-wii/wii_point_extractor.h b/tracker-pt/tracker-wii/wii_point_extractor.h new file mode 100644 index 00000000..290d1018 --- /dev/null +++ b/tracker-pt/tracker-wii/wii_point_extractor.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2015-2016 Stanislaw Halik <sthalik@misaki.pl> + * 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 + |