Alternative solution for QR code black/white balance computation.

This commit is contained in:
Alexander Smorkalov 2024-02-12 20:41:40 +03:00
parent 82914e442c
commit 0424ba57d7
2 changed files with 21 additions and 1 deletions

View File

@ -3070,7 +3070,10 @@ protected:
{
bool operator()(const Point2f& a, const Point2f& b) const
{
return a.y < b.y;
if (a.y != b.y)
return a.y < b.y;
else
return a.x < b.x;
}
};
struct compareSquare

View File

@ -614,4 +614,21 @@ TEST(Objdetect_QRCode_detectAndDecode, utf8_output)
EXPECT_NE(decoded_info.find("M\xc3\xbcllheimstrasse"), std::string::npos);
}
TEST_P(Objdetect_QRCode_detectAndDecodeMulti, detect_regression_24679)
{
const std::string name_current_image = "issue_24679.png";
const std::string root = "qrcode/";
std::string image_path = findDataFile(root + name_current_image);
Mat img = imread(image_path);
const std::string method = GetParam();
GraphicalCodeDetector qrcode = QRCodeDetector();
if (method == "aruco_based") {
qrcode = QRCodeDetectorAruco();
}
std::vector<cv::String> decoded_info;
ASSERT_TRUE(qrcode.detectAndDecodeMulti(img, decoded_info));
EXPECT_EQ(decoded_info.size(), 4U);
}
}} // namespace