From 692de4664b1aea87e634c541c00d77cb3f42006a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 10 Oct 2016 11:43:05 +0200 Subject: tracker/pt: get rid of heap allocation Use stack arrays rather than vectors. std::array may be a better choice though. --- tracker-pt/point_extractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tracker-pt/point_extractor.cpp') 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& 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(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) -- cgit v1.2.3