diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-21 19:56:50 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-21 20:34:49 +0200 |
commit | cc74649f357786be97c56573ae7b6339d0cde377 (patch) | |
tree | aa89e0713bea0f8083972b5d6f55b060d4bb1183 /tracker-pt | |
parent | 0cbf400004e94b626195b4938a0ccb942cf45b80 (diff) |
tracker/pt: fix area/radius confusion in extractor
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/point_extractor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<vec2>& 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<const float*>(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; |