mirror of
https://github.com/opencv/opencv.git
synced 2025-06-16 23:00:51 +08:00
Merge pull request #21003 from APrigarina:add_test_qrdetect_fix
This commit is contained in:
commit
6360b846c6
@ -649,6 +649,26 @@ TEST(Objdetect_QRCode_decodeMulti, check_output_parameters_type_19363)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Objdetect_QRCode_detect, detect_regression_20882)
|
||||||
|
{
|
||||||
|
const std::string name_current_image = "qrcode_near_the_end.jpg";
|
||||||
|
const std::string root = "qrcode/";
|
||||||
|
|
||||||
|
std::string image_path = findDataFile(root + name_current_image);
|
||||||
|
Mat src = imread(image_path);
|
||||||
|
ASSERT_FALSE(src.empty()) << "Can't read image: " << image_path;
|
||||||
|
|
||||||
|
QRCodeDetector qrcode;
|
||||||
|
std::vector<Point> corners;
|
||||||
|
Mat straight_barcode;
|
||||||
|
cv::String decoded_info;
|
||||||
|
EXPECT_TRUE(qrcode.detect(src, corners));
|
||||||
|
EXPECT_TRUE(!corners.empty());
|
||||||
|
#ifdef HAVE_QUIRC
|
||||||
|
EXPECT_NO_THROW(qrcode.decode(src, corners, straight_barcode));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
TEST(Objdetect_QRCode_basic, not_found_qrcode)
|
TEST(Objdetect_QRCode_basic, not_found_qrcode)
|
||||||
{
|
{
|
||||||
std::vector<Point> corners;
|
std::vector<Point> corners;
|
||||||
|
Loading…
Reference in New Issue
Block a user