Cannot perspective correct smallest (Version 1) QR codes

91 views
Skip to first unread message

Adrien Johnson

unread,
Feb 6, 2015, 9:05:29 PM2/6/15
to zx...@googlegroups.com
This seems to be a major issue. The simplest, smallest QR codes with the most easily distinguishable modules cannot be perspective corrected when decoding, meaning reading the QR code will fail if the camera is even a few degrees off to any side.

As I understand it, this is because the smallest (Version 1) QR codes have only the three large position markers in the corners, and no alignment markers, and ZXing currently needs at least 4 position+alignment markers to do perspective correction.

Is my understanding correct? What improvements are possible to the perspective and alignment finding algorithms. Are there similar problems with other 2D (or even 1D) formats where a lack of easily distinguishable alignment markers interferes with decoding, and could common work be done that would improve decoding with multiple formats?

Any insights into the library's architecture, feasibility of a fix, or where I should start poking around in the code to improve this would be very appreciated :)

Attached are a Version 2 and Version 1 QR code, see the difference in decoding for yourself.
Version 2.png
Version 1.png

Sean Owen

unread,
Feb 7, 2015, 9:17:30 AM2/7/15
to zx...@googlegroups.com
It uses the alignment pattern as a fourth anchor point to compute perspective distortion. Without it, it can still guess the perspective, and works except for significant perspective distortion. What problem are you reporting in practice? try scanning "Version 1" at a reasonable angle. I can scan it at about a 30-35 degree angle. You can resort to finding corners too, but it never made enough of a difference to bother with, especially since most QR codes are not version 2+.

Abel Sierra Sánchez

unread,
Feb 20, 2017, 6:59:54 AM2/20/17
to zxing
El sábado, 7 de febrero de 2015, 15:17:30 (UTC+1), Sean Owen escribió:
> It uses the alignment pattern as a fourth anchor point to compute perspective distortion. Without it, it can still guess the perspective, and works except for significant perspective distortion. What problem are you reporting in practice? try scanning "Version 1" at a reasonable angle. I can scan it at about a 30-35 degree angle. You can resort to finding corners too, but it never made enough of a difference to bother with, especially since most QR codes are not version 2+.

I've got the same issue using zxing for unity. On version 2 qr code works like a charm but with version 1 the phone must be completely parallel to the image to be able to scan it. Also with much bigger codes than version 2 works even better. I cannot figure out why this is happening, could be due to the resolution of the image? My cellphone is a Lg G3 with 2k resolution...

I would really appreciate any help on this :)

Best regards,
Abel

Abel Sierra Sánchez

unread,
Feb 20, 2017, 7:01:09 AM2/20/17
to zxing
Did you manage to fix this?

Thanks a lot in advance,

Abel
Reply all
Reply to author
Forward
0 new messages