Any idea to distinguish QRCode and 1D Barcode?

24 views
Skip to first unread message

Louis Dawson

unread,
Jul 18, 2013, 2:41:56 AM7/18/13
to zx...@googlegroups.com
It seems that ZXing just try every reader to find the right one. But if I would like to detect both 1d and 2d barcode, this method seems a little slow since when it is a qrcode it tries every 1d barcode and also the same when it is the 1d barcode. 

So is there any idea to distinguish QRCode and 1D Barcode before it tries every reader to decode? Thanks.

Sean Owen

unread,
Jul 18, 2013, 4:33:47 AM7/18/13
to zx...@googlegroups.com
Yes, use QRCodeReader to only look for QR codes, or similarly, something like Code39Reader to look for just Code 39. You can also choose a custom subset using hints while scanning for many formats.

Louis Dawson

unread,
Jul 18, 2013, 4:47:10 AM7/18/13
to zx...@googlegroups.com
Yes, I understand that. My problem is I have to support all of the barcode in one interface, I cannot let the users to choose. But it seems to be too slow if it check every readers in zxing. I would like to have a fast and smart algorithm to deside if this picture is most likely a 1d barcode or qrcode (detect not decode) before it choose which reader should use first.

This can be very helpful for this kind of usage.

在 2013年7月18日星期四UTC+8下午4时33分47秒,Sean Owen写道:

Sean Owen

unread,
Jul 18, 2013, 9:13:40 AM7/18/13
to zx...@googlegroups.com
I don't think you can decide there is a barcode in the image without looking for them. You can restrict to the several formats you support and not look for others. It's really quite fast, are you sure? 100ms on a phone to look for everything in a frame.

Bas Vijfwinkel

unread,
Jul 19, 2013, 1:11:04 AM7/19/13
to zx...@googlegroups.com
Another approach would be to keep a history of successfully decoded bar codes and to implement a dynamic order for scanning all bar code types.
With such a history you can arrange the order of which type of bar code needs to be tested first.
I presume most people just scan 1 or 2 types so based upon that history, those 2 types will be tested first.
Types one does not use at all will thus be scanned last.


Reply all
Reply to author
Forward
0 new messages