How to improve QRCode decoding robustness?

162 views
Skip to first unread message

kristofd

unread,
Oct 14, 2013, 2:59:13 AM10/14/13
to zx...@googlegroups.com

Hi,

I am writing an application that needs to decode QRcode images. I have used zxing but have not achieved the robustness I need.

Any hints on how to improve robustness? I have used the following code (based on the example servlet):

LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new GlobalHistogramBinarizer(source));
Collection<Result> results = Lists.newArrayListWithCapacity(1);

Reader reader = new QRCodeReader();
Result theResult = reader.decode(bitmap, HINTS);

Using this pipeline we are unfortunately unable to decode a sharp image with good contrast (but some perspective distortion). Any tips would be appreciated!




Regards,

Kristoffer

kristofd

unread,
Oct 14, 2013, 3:20:31 AM10/14/13
to zx...@googlegroups.com
Here is an example image that our current code is unable to decode.


Kristoffer
qr.jpg

Sean Owen

unread,
Oct 14, 2013, 4:09:37 AM10/14/13
to zx...@googlegroups.com
The problem is that you have significant perspective distortion, but are using a Version 1 QR code, which has no alignment pattern. Use a Version 2 or higher code. That is, add more error correction or data to the payload to make it need a larger QR code that has an alignment pattern at the bottom right.

kristofd

unread,
Oct 14, 2013, 9:53:19 AM10/14/13
to zx...@googlegroups.com

Ok!

Thank you very much for the quick response.

We tried QR codes with higher version numbers and also variants with more error correction data and were able to read those without problems.

So I consider my problem/question solved :)



Kristoffer
Reply all
Reply to author
Forward
0 new messages