From 4412c3bcc060b75ae8e77285711d2ad257bd8f9a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 15 Jun 2017 10:25:44 +0200 Subject: tracker/pt: tweak meanshift cpu usage --- tracker-pt/point_extractor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tracker-pt/point_extractor.cpp') diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp index fbe2b936..c2780392 100644 --- a/tracker-pt/point_extractor.cpp +++ b/tracker-pt/point_extractor.cpp @@ -112,7 +112,7 @@ void PointExtractor::extract_points(const cv::Mat& frame, cv::Mat& preview_frame static constexpr double max_radius = 15; const double radius = fmax(0., (max_radius-min_radius) * s.threshold / 255 + min_radius); - const float* ptr = reinterpret_cast(hist.ptr(0)); + const float* OTR_RESTRICT ptr = reinterpret_cast(hist.ptr(0)); const unsigned area = uround(3 * M_PI * radius*radius); const unsigned sz = unsigned(hist.cols * hist.rows); unsigned thres = 1; @@ -246,7 +246,7 @@ end: cv::Vec2d com_new = MeanShiftIteration(frame_roi, pos, kernel_radius); cv::Vec2d delta = com_new - pos; pos = com_new; - if (delta.dot(delta) < 1e-2 * 1e-2) + if (delta.dot(delta) < 1e-2) break; } -- cgit v1.2.3