Scanning QR code in high resolution images

15,751 views
Skip to first unread message

chak li

unread,
Dec 1, 2012, 2:13:13 AM12/1/12
to zx...@googlegroups.com
Dear all, 

I am trying to scan a QR code from photos using ZXing 2.1 with Nexus One.
However, ZXing cannot scan it as it takes too much memory.
Then I resize it from original 2592*1944 to 580*435.
It still cannot scan the QR code.
I found that it has error on finding finder pattern or getting version information in scanning.
What should I do to scan the QR code? All I need is a direction to do it.

I am thinking of modifying the code in finding finder pattern so that it can scan the QR code.
May I know how ZXing find finder pattern of QR code in an image?
I tried to read the source code of FinderPattern.java in QR code detector in core of ZXing.
But I really cannot understand the algorithm to detect finder pattern from it.

Besides, may I also know why the dimension (number of modules on a size) of QR code has to be 1 mod 4?
I see this in computeDimension() in Detector.java in com.google.zxing.qrcode.detector

Attached are the images of related QR code. (CapQRcodeLargeDocOriginal.jpg, CapQRcodeLargeDoc580435.jpg)

I also notice that some images can be scanned on Web based Zxing Decoder Online (http://zxing.org/w/decode.jspx) but not on Android version.
CapQRcodeClearest10001045.jpg is one of the examples.
The errors I can find are also about finding finder pattern or getting version information.
What is the difference between scanners in Web based and Android version?
Only general differences like scanning algorithm or image rendering will do. I can find the details myself.

Sorry for making so many questions. Thanks in advance.
CapQRcodeClearest10001045.jpg
CapQRcodeLargeDoc580435.jpg

chak li

unread,
Dec 1, 2012, 2:16:02 AM12/1/12
to zx...@googlegroups.com
CapQRcodeLargeDocOriginal.jpg is located at https://plus.google.com/photos/105482764313565130336/albums/5816872101835131601?authkey=CMfmjoeVhoCpxQE

Thank you again

chak li於 2012年12月1日星期六UTC+8下午3時13分13秒寫道:

Sean Owen

unread,
Dec 1, 2012, 9:14:08 AM12/1/12
to zx...@googlegroups.com
Do you mean Barcode Scanner? It doesn't use resolution this high; it only uses preview frames. Are you talking about your own app? I think you mean that the app heap isn't big enough to load an image of this size into memory.
It's not surprising that this image doesn't scan, just from inspection. You are welcome to look at the code and ask specific questions but it's not useful to ask a "how does it all work" question.
Read the QR code spec if you have questions about the spec, like dimensions associated with each version.
The online decoder is able to spend a lot more time reading the image and so succeeds in more cases. Look at TRY_HARDER mode in the source -- or better yet look at the source code to the decoder under zxingorg/. 
Reply all
Reply to author
Forward
0 new messages