From 9c86d68b4ce32051843f130b616ef26bfe96da5c Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 13 Nov 2023 10:49:19 +0300 Subject: [PATCH] remove filter fix --- modules/objdetect/src/qrcode.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/modules/objdetect/src/qrcode.cpp b/modules/objdetect/src/qrcode.cpp index 05f8dabeb6..811337b416 100644 --- a/modules/objdetect/src/qrcode.cpp +++ b/modules/objdetect/src/qrcode.cpp @@ -4476,25 +4476,14 @@ static vector analyzeFinderPatterns(const vector > &corners, const Mat& img, const QRCodeDetectorAruco::Params& qrDetectorParameters) { vector qrCodes; - vector patterns; + vector patterns(corners.size()); if (img.empty()) return qrCodes; float maxModuleSize = 0.f; for (size_t i = 0ull; i < corners.size(); i++) { FinderPatternInfo pattern = FinderPatternInfo(corners[i]); - // TODO: improve thinning Aruco markers - bool isUniq = true; - for (const FinderPatternInfo& tmp : patterns) { - Point2f dist = pattern.center - tmp.center; - if (max(abs(dist.x), abs(dist.y)) < 3.f * tmp.moduleSize) { - isUniq = false; - break; - } - } - if (isUniq) { - patterns.push_back(pattern); - maxModuleSize = max(maxModuleSize, patterns.back().moduleSize); - } + patterns[i] = pattern; + maxModuleSize = max(maxModuleSize, pattern.moduleSize); } const int threshold = cvRound(qrDetectorParameters.minModuleSizeInPyramid * 12.5f) + (cvRound(qrDetectorParameters.minModuleSizeInPyramid * 12.5f) % 2 ? 0 : 1);