diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-07 11:01:19 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:48:46 +0100 |
commit | 22d3ded34963e663f289c181aa94b54f00693b34 (patch) | |
tree | aad6c435cc1c04609315c8a03c3aa65e09451f26 /tracker-wii/wii_point_extractor.cpp | |
parent | 442c6251669a387b1b8b75b9cb90eec6ee9a8b9b (diff) |
tracker/{pt,wii}: allow float/double in cv/numeric
Diffstat (limited to 'tracker-wii/wii_point_extractor.cpp')
-rw-r--r-- | tracker-wii/wii_point_extractor.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tracker-wii/wii_point_extractor.cpp b/tracker-wii/wii_point_extractor.cpp index b73925bc..11b48d8f 100644 --- a/tracker-wii/wii_point_extractor.cpp +++ b/tracker-wii/wii_point_extractor.cpp @@ -44,8 +44,8 @@ void WIIPointExtractor::draw_point(cv::Mat& preview_frame, const vec2& p, const { static constexpr int len = 9; - cv::Point p2(iround(p[0] * preview_frame.cols + preview_frame.cols / 2), - iround(-p[1] * preview_frame.cols + preview_frame.rows / 2)); + cv::Point p2(iround(p[0] * preview_frame.cols + preview_frame.cols / f{2}), + iround(-p[1] * preview_frame.cols + preview_frame.rows / f{2})); cv::line(preview_frame, cv::Point(p2.x - len, p2.y), @@ -66,14 +66,14 @@ bool WIIPointExtractor::draw_points(cv::Mat& preview_frame, const struct wii_inf points.reserve(4); points.clear(); - for (unsigned index = 0; index < 4; index++) + for (unsigned index = 0; index < 4; index++) // NOLINT(modernize-loop-convert) { const struct wii_info_points &dot = wii.Points[index]; if (dot.bvis) { //qDebug() << "wii:" << dot.RawX << "+" << dot.RawY; //anti-clockwise rotate the 2D point - const double RX = W - dot.ux; - const double RY = H - dot.uy; + const f RX = W - dot.ux; + const f RY = H - dot.uy; //vec2 dt((dot.RawX - W / 2.0f) / W, -(dot.RawY - H / 2.0f) / W); //vec2 dt((RX - W / 2.0f) / W, -(RY - H / 2.0f) / W); //vec2 dt((2.0f*RX - W) / W, -(2.0f*RY - H ) / W); @@ -99,8 +99,8 @@ void WIIPointExtractor::draw_bg(cv::Mat& preview_frame, const struct wii_info& w 2); //draw horizon - int pdelta = iround((preview_frame.rows / 4.) * tan(((double)wii.Pitch)* pi / f(180))); - int rdelta = iround((preview_frame.cols / 4.) * tan(((double)wii.Roll)* pi / f(180))); + int pdelta = iround((preview_frame.rows / f{4}) * tan(((double)wii.Pitch)* pi / f(180))); + int rdelta = iround((preview_frame.cols / f{4}) * tan(((double)wii.Roll)* pi / f(180))); cv::line(preview_frame, cv::Point(0, preview_frame.rows / 2 + rdelta - pdelta), |