Skip to content

fixed issue with Mat reshape in decodeMulti() - #16491

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

alalek merged 3 commits into
opencv:3.4from
rayonnant14:objdetect_decodeMulti_issue

Conversation

@rayonnant14

@rayonnant14 rayonnant14 commented Feb 3, 2020 •

Copy link
Copy Markdown
Contributor

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

alalek commented Feb 3, 2020

Copy link
Copy Markdown
Member

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.

@alalek alalek left a comment

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.

Well done! Test looks good to me

Comment thread modules/objdetect/test/test_qrcode.cpp Outdated
#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
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
…i_issue

* fixed issue with Mat reshape in decodeMulti()

* added test for decodeMulti

* used assign
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