summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/point_extractor.cpp7
-rw-r--r--tracker-pt/point_extractor.h2
2 files changed, 4 insertions, 5 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);
diff --git a/tracker-pt/point_extractor.h b/tracker-pt/point_extractor.h
index 67b2b8ea..52b4cb32 100644
--- a/tracker-pt/point_extractor.h
+++ b/tracker-pt/point_extractor.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2012 Patrick Ruoff
+ * 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
@@ -29,7 +30,6 @@ public:
settings_pt s;
private:
static constexpr double pi = 3.14159265359;
- static constexpr int hist_c = 1;
std::vector<vec2> points;
QMutex mtx;