diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-16 23:49:48 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-16 23:54:31 +0200 |
commit | 1938853fd7b5889f0381a6ad120f877b649d4887 (patch) | |
tree | 96be852a1b9c86ef3554a8efc4fa6dd214e43e53 /tracker-pt/point_extractor.cpp | |
parent | c031551efd47e56384c46342df8a5b2030f19fb4 (diff) |
tracker/pt: don't scale down auto threshold value
Also, make the slider signify the max point radius (hence squaring).
Diffstat (limited to 'tracker-pt/point_extractor.cpp')
-rw-r--r-- | tracker-pt/point_extractor.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp index f52ab424..e3472391 100644 --- a/tracker-pt/point_extractor.cpp +++ b/tracker-pt/point_extractor.cpp @@ -1,5 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff - * Copyright (c) 2014-2015 Stanislaw Halik <sthalik@misaki.pl> + * Copyright (c) 2015-2016 Stanislaw Halik <sthalik@misaki.pl> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -62,7 +62,7 @@ const std::vector<vec2>& PointExtractor::extract_points(cv::Mat& frame) int val = 0; int cnt = 0; constexpr int min_pixels = int(10 * 10 * 3 * pi); - const int pixels_to_include = std::max<int>(0, min_pixels * s.threshold / 255); + const int pixels_to_include = std::max<int>(0, min_pixels * s.threshold * s.threshold / (256 * 256)); auto ptr = reinterpret_cast<const float*>(hist.ptr(0)); for (int i = sz-1; i >= 0; i--) { @@ -73,8 +73,7 @@ const std::vector<vec2>& PointExtractor::extract_points(cv::Mat& frame) break; } } - val *= hist_c; - val *= 240./256.; + //val *= 240./256.; //qDebug() << "val" << val; cv::threshold(frame_gray, frame_bin, val, 255, CV_THRESH_BINARY); |