summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-08 02:34:46 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-08 02:34:46 +0100
commit143ffce5486739368a9b35c10f2e8a7ad22a2236 (patch)
treeda1b969562f870d0fc678697cf85eefdf4dcff06
parentd6eb142710e6ac307b4c5c0e0a54166852d71cbc (diff)
tracker/pt: reduce auto thresholding histogram bucket size
Previously it was too slow to 640x480@75.
-rw-r--r--tracker-pt/point_extractor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp
index ec37dd00..e1d55b8d 100644
--- a/tracker-pt/point_extractor.cpp
+++ b/tracker-pt/point_extractor.cpp
@@ -67,12 +67,13 @@ std::vector<cv::Vec2f> PointExtractor::extract_points(cv::Mat& frame)
else
{
cv::Mat hist;
+ constexpr int hist_c = 6;
cv::calcHist(std::vector<cv::Mat> { frame_gray },
std::vector<int> { 0 },
cv::Mat(),
hist,
- std::vector<int> { 256 },
- std::vector<float> { 0, 256 },
+ std::vector<int> { 256/hist_c },
+ std::vector<float> { 0, 256/hist_c },
false);
const int sz = hist.rows*hist.cols;
int val = 0;
@@ -88,6 +89,7 @@ std::vector<cv::Vec2f> PointExtractor::extract_points(cv::Mat& frame)
break;
}
}
+ val *= hist_c;
val *= 240./256.;
//qDebug() << "val" << val;