summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-21 19:56:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-21 20:17:13 +0200
commit279adab86eb9791c23f97b393fe397d1fdd2e46a (patch)
treef25c68170aa1cff6ce0b84cc8b707b289441dc66 /tracker-pt
parent3afac8dc868cb5cd186dbdf12475973391164ecd (diff)
tracker/pt: fix area/radius confusion in extractor
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/point_extractor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp
index 1b06df5a..192beacd 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<cv::Vec2d>& poin
const int sz = hist.cols * hist.rows;
int thres = 255;
int cnt = 0;
- constexpr double min_radius = 4;
- constexpr double max_radius = 15;
+ constexpr double min_radius = 2.5;
+ constexpr double max_radius = 9;
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;