summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point_extractor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-10 11:43:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-10 11:43:05 +0200
commit692de4664b1aea87e634c541c00d77cb3f42006a (patch)
tree0a7bcc3d476b426602ff5d7478c7354e2d54cbee /tracker-pt/point_extractor.cpp
parent9bf8a1ca15d5982c15832656343df4b49baff299 (diff)
tracker/pt: get rid of heap allocation
Use stack arrays rather than vectors. std::array may be a better choice though.
Diffstat (limited to 'tracker-pt/point_extractor.cpp')
-rw-r--r--tracker-pt/point_extractor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp
index 48816780..7cd46fe2 100644
--- a/tracker-pt/point_extractor.cpp
+++ b/tracker-pt/point_extractor.cpp
@@ -69,7 +69,7 @@ void PointExtractor::extract_points(cv::Mat& frame, std::vector<vec2>& points)
const double radius = max(0., (max_radius-min_radius) * s.threshold / 256);
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--)
+ for (int i = sz-1; i > 1; i--)
{
cnt += ptr[i];
if (cnt >= area)