1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2025-10-01 10:27:32 +03:00
40 changed files with 188 additions and 63 deletions
+6 -1
View File
@@ -2921,7 +2921,12 @@ std::string ImplContour::decode(InputArray in, InputArray points, OutputArray st
vector<Point2f> src_points;
points.copyTo(src_points);
CV_Assert(src_points.size() == 4);
CV_CheckGT(contourArea(src_points), 0.0, "Invalid QR code source points");
if (contourArea(src_points) <= 0.0)
{
if (straight_qrcode.needed())
straight_qrcode.release();
return std::string();
}
QRDecode qrdec(useAlignmentMarkers);
qrdec.init(inarr, src_points);
+1 -1
View File
@@ -470,7 +470,7 @@ TEST(Objdetect_QRCode_basic, not_found_qrcode)
QRCodeDetector qrcode;
EXPECT_FALSE(qrcode.detect(zero_image, corners));
corners = std::vector<Point>(4);
EXPECT_ANY_THROW(qrcode.decode(zero_image, corners, straight_barcode));
EXPECT_NO_THROW(qrcode.decode(zero_image, corners, straight_barcode));
}
TEST(Objdetect_QRCode_detect, detect_regression_21287)