Skip to content

fixed issue with Mat reshape in decodeMulti()#16491

Merged
alalek merged 3 commits intoopencv:3.4from
rayonnant14:objdetect_decodeMulti_issue
Feb 4, 2020
Merged

fixed issue with Mat reshape in decodeMulti()#16491
alalek merged 3 commits intoopencv:3.4from
rayonnant14:objdetect_decodeMulti_issue

Conversation

@rayonnant14
Copy link
Copy Markdown
Contributor

@rayonnant14 rayonnant14 commented Feb 3, 2020

solved problem with incorrect processing of transformation points in method QRCodeDetector::decodeMulti()

relates #15338

@asmorkalov
Copy link
Copy Markdown
Contributor

@rayonnant14 Could you add a test for the resolved bug?

@asmorkalov asmorkalov added category: objdetect pr: needs test New functionality requires minimal tests set labels Feb 3, 2020
@alalek
Copy link
Copy Markdown
Member

alalek commented Feb 3, 2020

Add simple "bad" test (~10 lines): TEST(Objdetect_QRCode_Multi, decode_regression_16491)
Use EXPECT_NO_THROW(qrcode.decodeMulti(...)); as check.
Don't load any images. Don't check accuracy.
Hardcode points. Use zero input image if possible.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Test looks good to me

#ifdef HAVE_QUIRC
Mat zero_image = Mat::zeros(256, 256, CV_8UC1);
std::vector<Point> vec_corners{Point(16, 16), Point(128, 16), Point(128, 128), Point(16, 128),
Point(16, 16), Point(128, 16), Point(128, 128), Point(16, 128)};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++11 is not allowed in OpenCV tests on 3.4 branch by default.
Please use Points corners_[] = {...}; array + vector::assign()

@alalek alalek merged commit 4e4dfff into opencv:3.4 Feb 4, 2020
@alalek alalek mentioned this pull request Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants