summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-02-22 15:34:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-02-22 15:34:22 +0100
commitdb9167199aef8b976d4c4e9d479edd001c807418 (patch)
tree36bd68e58cdca9abf7650ea39dcd2eb7c4e91a99
parent20e0e96d324603fa00b1d4a3654210904ab164ea (diff)
tracker/pt: fix capture resolution scaling
-rw-r--r--tracker-pt/module/point_extractor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp
index 17f03f4d..298d8752 100644
--- a/tracker-pt/module/point_extractor.cpp
+++ b/tracker-pt/module/point_extractor.cpp
@@ -209,9 +209,9 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob
const f cx = preview_frame.cols / f(size.width),
cy = preview_frame.rows / f(size.height),
- c = (cx+cy)/2;
+ c = std::fmax(f(1), cx+cy)/2;
- constexpr unsigned fract_bits = 16;
+ constexpr unsigned fract_bits = 8;
constexpr int c_fract(1 << fract_bits);
cv::Point p(iround(b.pos[0] * cx * c_fract), iround(b.pos[1] * cy * c_fract));
@@ -220,9 +220,9 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob
? cv::Scalar(192, 192, 192)
: cv::Scalar(255, 255, 0);
- const int overlay_size = (double)dpi > 1.5 ? 2 : 1;
+ const int overlay_size = iround(dpi);
- cv::circle(preview_frame, p, iround((b.radius + f(3.3)) * c * c_fract),
+ cv::circle(preview_frame, p, iround((b.radius + f(3.3) * c) * c_fract),
circle_color, overlay_size,
cv::LINE_AA, fract_bits);