diff options
author | Stéphane Lenclud <github@lenclud.com> | 2019-04-28 00:03:24 +0200 |
---|---|---|
committer | Stéphane Lenclud <github@lenclud.com> | 2019-04-28 00:03:24 +0200 |
commit | 3e56f47a9cef709d4a099a0ac6ff43e361fe4a43 (patch) | |
tree | a8968cb73e7568902c83bb2275982ac23261a2f7 /tracker-easy/point-extractor.cpp | |
parent | 518becf76bb5313949c76e9fa02d1ada2c25242d (diff) |
Easy Tracker: UI rework for custom model with three, four or five vertices.
More settings can be changed live without have to restart the tracker.
Fixing a few deadlock issues.
Diffstat (limited to 'tracker-easy/point-extractor.cpp')
-rw-r--r-- | tracker-easy/point-extractor.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tracker-easy/point-extractor.cpp b/tracker-easy/point-extractor.cpp index 0a5ca81d..b7cf7356 100644 --- a/tracker-easy/point-extractor.cpp +++ b/tracker-easy/point-extractor.cpp @@ -29,12 +29,19 @@ using namespace numeric_types; namespace EasyTracker { - PointExtractor::PointExtractor() : s(KModuleName) + PointExtractor::PointExtractor() : iSettings(KModuleName) { - + UpdateSettings(); } + /// + void PointExtractor::UpdateSettings() + { + iMinPointSize = iSettings.iMinBlobSize; + iMaxPointSize = iSettings.iMaxBlobSize; + } + /// void PointExtractor::ExtractPoints(const cv::Mat& aFrame, cv::Mat* aPreview, int aNeededPointCount, std::vector<cv::Point>& aPoints) { //TODO: Assert if channel size is neither one nor two @@ -108,10 +115,10 @@ namespace EasyTracker bBox = cv::boundingRect(iContours[i]); // Make sure bounding box matches our criteria - if (bBox.width >= s.min_point_size - && bBox.height >= s.min_point_size - && bBox.width <= s.max_point_size - && bBox.height <= s.max_point_size) + if (bBox.width >= iMinPointSize + && bBox.height >= iMinPointSize + && bBox.width <= iMaxPointSize + && bBox.height <= iMaxPointSize) { // Do a mean shift or cam shift, it's not bringing much though //cv::CamShift(iFrameGray, bBox, cv::TermCriteria(cv::TermCriteria::EPS + cv::TermCriteria::MAX_ITER, 10, 1)); |