summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-15 10:25:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:48:42 +0200
commit4412c3bcc060b75ae8e77285711d2ad257bd8f9a (patch)
tree2a852bd631e9905a09d071d8084f6af23e7ce012
parent91ca9029bef598d459d9ab6bbab788e534cef45f (diff)
tracker/pt: tweak meanshift cpu usage
-rw-r--r--tracker-pt/point_extractor.cpp4
1 files changed, 2 insertions, 2 deletions
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<const float*>(hist.ptr(0));
+ const float* OTR_RESTRICT ptr = reinterpret_cast<const float*>(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;
}