From cc74649f357786be97c56573ae7b6339d0cde377 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 21 Sep 2016 19:56:50 +0200 Subject: tracker/pt: fix area/radius confusion in extractor --- tracker-pt/point_extractor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp index 26bbe2f3..274c0ccb 100644 --- a/tracker-pt/point_extractor.cpp +++ b/tracker-pt/point_extractor.cpp @@ -64,15 +64,15 @@ void PointExtractor::extract_points(cv::Mat& frame, std::vector& points) const int sz = hist.cols * hist.rows; int thres = 255; int cnt = 0; - constexpr double min_radius = 4; + constexpr double min_radius = 2.5; constexpr double max_radius = 15; const double radius = max(0., (max_radius-min_radius) * s.threshold / 256); - const int pixels_to_include = int((min_radius + radius)*(min_radius+radius) * 3); + const int area = int(round(3 * M_PI * (min_radius + radius)*(min_radius+radius))); auto ptr = reinterpret_cast(hist.ptr(0)); for (int i = sz-1; i > 0; i--) { cnt += ptr[i]; - if (cnt >= pixels_to_include) + if (cnt >= area) { thres = i; break; -- cgit v1.2.3