Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test cases containing a large in-the-wild image, and two rotated versions #27

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jjhbw
Copy link

@jjhbw jjhbw commented May 2, 2020

One of the rotated versions fails (test_wild_rotated_1), likely because the QR code is too tilted.

We don't have to retain the other two tests, as these cases are pretty much already covered.

In debug-images mode, i found that test_wild_rotated_1 gives the following candidates.png:

candidates

My naive analysis would be that the top-right finder is a false positive.

@jjhbw jjhbw marked this pull request as draft May 2, 2020 13:13
…d to an extraction, but decoding still fails
@jjhbw
Copy link
Author

jjhbw commented May 3, 2020

Slightly decreasing the accepted variance of the finder pattern seemed to at least make the detection work, but now decoding fails. The error correction seems to have trouble, if i read the code correctly.

@piderman314
Copy link
Owner

Yeah you can see the debug image in the extract directory, it appears it can find the data quite accurately, but it's not 100% correct, causing it to have more errors than the correction can handle.

extract_start_318 07142857142907_153 57142857142847_dx_-4 357142857142857_-1 8571428571428572_dy_1 6428571428571428_-4 357142857142857

@piderman314
Copy link
Owner

Come to think of it, this also has to do with the fact that this is a version 1 QR Code which doesn't have an extra alignment pattern. Can you try this kind of rotation with a level 2+ QR Code?

@jjhbw
Copy link
Author

jjhbw commented May 3, 2020

Ah yeah i saw that second image too. It seems to miss a few of the black squares (duh ;)).
What would testing a v2 tell us? Or are v1 QR codes out of scope?

@piderman314
Copy link
Owner

A v2 (and up) code has an extra special square in the bottom right corner that helps adjusting the angle a bit better. In the end, we have to estimate the angle and skew of the image based on discrete data (pixels). This is always going to be wrong to a certain degree, resulting in missed squares.

I'm not sure it's possible to get the estimation any better for a v1 image that has been rotated quite this much.

I'm just curious if a v2 code that has been rotated in the same way would fare better because of the extra alignment pattern. (See the version3_example test case for an example that has that pattern in the bottom right).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants