From d90d57a85d81bc16e14310e41c820f47e110e484 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Feb 2017 20:20:17 +0100 Subject: tracker/pt: change meanshift kernel size coefficient From my usage the value of 1.5 is excessively conservative. --- tracker-pt/point_extractor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp index 3109db09..8cd4e1f3 100644 --- a/tracker-pt/point_extractor.cpp +++ b/tracker-pt/point_extractor.cpp @@ -223,6 +223,7 @@ end: { blob &b = blobs[idx]; cv::Rect rect = b.rect; + rect.x -= rect.width / 2; rect.y -= rect.height / 2; rect.width *= 2; @@ -231,7 +232,11 @@ end: cv::Mat frame_roi = frame_gray(rect); - const double kernel_radius = b.radius * 1.5; + // smaller values mean more changes. 1 makes too many changes while 1.5 makes about .1 + // seems values close to 1.3 reduce noise best with about .15->.2 changes + static constexpr double radius_c = 1.3; + + const double kernel_radius = b.radius * radius_c; cv::Vec2d pos(b.pos[0] - rect.x, b.pos[1] - rect.y); // position relative to ROI. for (int iter = 0; iter < 10; ++iter) -- cgit v1.2.3