From 1938853fd7b5889f0381a6ad120f877b649d4887 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 16 Jul 2016 23:49:48 +0200 Subject: tracker/pt: don't scale down auto threshold value Also, make the slider signify the max point radius (hence squaring). --- tracker-pt/point_extractor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tracker-pt/point_extractor.cpp') 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 + * Copyright (c) 2015-2016 Stanislaw Halik * * 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& 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(0, min_pixels * s.threshold / 255); + const int pixels_to_include = std::max(0, min_pixels * s.threshold * s.threshold / (256 * 256)); auto ptr = reinterpret_cast(hist.ptr(0)); for (int i = sz-1; i >= 0; i--) { @@ -73,8 +73,7 @@ const std::vector& 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); -- cgit v1.2.3