ZBar vs. zxing - QR recognition comparison
Asked Answered
S

4

14

Can anyone tell which library is better in small QR Codes recognition under low lighting conditions? Platform is iPhone 4/iOS 5 I tried both Barcodes (zxing) and the ZBar apps and it seems that zxing was noticeably better in recognizing the codes under "hard" conditions. That said, it wasn't a very large sample test.

Any inputs on the actual image recognition capabilities (speed+quality) of both libraries would be helpful.

TIA.

Submultiple answered 19/1, 2012 at 20:46 Comment(1)
I doubt either will be significantly better actually, as small QR codes are pretty easy to scan in the scheme of things. zxing is especially good at QR codes though, but its C++ port is a bit stale compared to the Java version. I don't have hard figures either way but I wrote this part of zxing.Frausto
S
8

As for me ZXing is better. I have used them both at work for iOS application.

  1. With ZBar I had problems with large QRCodes.

  2. ZXing works fine on iPhone 4 and 3GS, but Zbar works worse on 3GS, some times it just can't capture the code.

Sacring answered 22/1, 2012 at 10:54 Comment(3)
More than just QR code decoding has been ported from Java to C++ in zxing, though I somewhat agree with your last point in that these ports are even more spotty and stale compared to the Java version.Frausto
You should take a look at this : ttp://zbar.sourceforge.net/iphone/sdkdoc/optimizing.html, performance wise, using the ZBar defaults will create issues with large v40 QRCodes - the solution is to set the videoQuality property to UIImagePickerControllerQualityTypeHigh instead of the default 640x480 (found in UIImagepickerController apple docs. I tried both SDK about a year ago, I like the ZXing sample app whi ch provides an idea of an independent parser, listing of action items and the added security of allowing the user to choose to perform the action or not.Zara
This is old question but does it work for both QRCode and Barcode or do i have to manage them using separate library ? I need the ability to scan both qr and bar code , which would you recommend?Malvern
Z
2

You should take a look at this link. Performance wise, using the ZBar defaults will create issues with large v40 QRCodes - the solution is to set the videoQuality property to UIImagePickerControllerQualityTypeHigh instead of the default 640x480 (Apple docs). As per documentation, the barcode module size need to be at least 3 pixels in size to scan. I tried both SDK around a year ago, I like the ZXing sample app, but in the end prior to appstore submission, I found it generated a lot of warning messages that I find hard to remove. Switching to ZBar allowed me to cleanup the message and add capability to scan several 1D Barcode types to my app. As mentioned the default settings will not give you optimal performance but you need to look into the options, turn off the ones you don't need, stripped bare it should perform reasonably well.

I am pretty happy with ZBar at the moment but will likely switch if ZXing support for other barcode types particularly DataMatrix, PDF417, Aztec and Maxi Code become available.

Zara answered 3/4, 2013 at 0:58 Comment(4)
I recently committed support for most of the 1D (excluding RSS and some of the UPC/EAN extensions) and 2D (excluding PDF-417 which someone else is doing) codes which are supported in Java (doesn't include Maxicodes). Not sure about build warnings. There are some in the widget since it predates ARC.Spina
@Zara Does does zbar support DataMatrix? Do you know that symbol to be used for it?Fellows
Far as I know Zbar was never updated for 64bit, so a lot of us has moved to either ZXING or the Native barcode capability of IOS "AVCaptureMetaDataOutput" which as of IOS 9 supports DataMatrix and almost all other except for DataBar.Zara
Just a side observation and I am not sure where the root cause is: The zxing recognition of pdf417 format seems poor compared the Denso wave QR code format.Suspensor
G
2

I have found that Zxing very good on the later iPads and iPhones. The iPad 2 camera was very slow with Zxing, but the later cameras were much faster and have better focusing, which improved speed considerably.

One "hack" I did with Zxing on iPad 2 is to change the rectangle in code. I would progressively zoom out on each attempt, so rather than use the rectangle shown I would expand it out in steps, so I would check 5 times for each scan. The results were much much improved. On the iPad 3 etc this was not so necessary, but still I have the code in there and it is fast.

I have used both ZBar and ZXing in Windows using scanners (300 DPI), and found dense QRCodes a problem for ZXIng and had to include ZBar support. Implementing ZBar support was very tricky and had to write my own API, if anyone is interested.

Garris answered 14/6, 2015 at 23:46 Comment(2)
Can you add more info what you mean by dense QRCodes a problem for ZXing ? What QR version is it? Or is it the number of pixels per module? Is it in picture feed or video feed?Suspensor
This was a while ago (5 years?) but I recall basically qrcodes with a lot of data in them. So if you choose a QRcode size and put either a small string or a huge string, the huge string would be harder to read - presumably the number of pixels in the amount space available increases. This was from a picture (a 300 DPI scanner). ZXIng has moved on since then so maybe better now. I do recall I even used both libraries - so I'd try both and compare and use the results. It was statistically more accurate.,Garris
G
1

I've used both of them. You have to use ZXing if you want scan data matrix codes. But if you don't need data matrix, using ZBar is a fast and easy way. Also, there is a built-in scanner API in iOS 7, AVCaptureMetaDataOutput that scans 1D and 2D codes except data matrix. I'd prefer AVCaptureMetaDataOutput because of simplicity. Here is a guide for AVCaptureMetaDataOutput.

Grandparent answered 3/1, 2014 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.