Reputation: 25
How reliable is ZXing's barcode localization for DataMatrix decoding compared to libdmtx?
I have a set of png image files of stickers (proprietary, so unfortunately I'm not able to share them) containing DataMatrix barcodes. These stickers sit on flat surfaces, have very nice quiet zones and are generally centered in the image, but suffer from inequal lighting conditions and slight dust, likely the largest obstacle to reliable decoding.
I'd like to use a modifiable Java library to decode them and it seems that ZXing is the only open-source option (open to other suggestions). However, upon running these images through the ZXing online decoder, I consistently get NO BARCODE FOUND, even on the cleanest images. In contrast, when I run the same images through proprietary online decoders, like Inlite's Free Online Barcode Reader, I get reliable decodes for all the images. My company has implemented a library in C that also reliable decodes the barcode images by processing them and calling libdmtx. Similarly, this online DataMatrix decoder built on libdmtx can also reliably read my image files.
Is the barcode localization in ZXing significantly inferior to libdmtx? If I attempt the same preprocessing on the image files before I run them through ZXing, could I achieve similar results? I have a strong preference for a Java library (ZXing), but I may have no choice but to use libdmtx. Would appreciate any insight, thanks!
Upvotes: 2
Views: 3854
Reputation: 55
I know this is an old post, but wanted to throw in my experience dealing with libdmtx and the newer c++ version of zxing (zxing-cpp 2.0), in case it helps anyone else.
Initially, I was using pyzbar to decode QR codes, but decided that QR was a bit too finicky about printing quality (17,000+/hour print of the barcodes). Data Matrix (DM) seemed like a logical solution, having better tolerances (from what I've read). I initially built using libdmtx, but found the slowdown was substantial when compared to QR read/decode through pyzbar.
I later discovered the ZXing-cpp build, started using that because of decoding most common barcodes using one library, and it's wicked-fast! My only quibble so far with zxing is the DM orientation issue. I've tested using my camera, and orientation of DM causes the detection ROI to be very limited (left-to-right didn't lose much, but top-to-bottom I lost about 40% of my camera's FOV for detection -- see image attached). Note: white bars across are overlay, not part of the camera view.
Upvotes: 2
Reputation: 1119
Another alternative is the relatively new ZXing cpp port here: https://github.com/nu-book/zxing-cpp.
It contains a completely new DataMatrix detector that was meant to fix serious limitations of the Java upstream version. It was specifically designed to deal with low resolution images (module size as low as around 2 pixels) and symbols that have just the required 1 module quite zone and a busy background.
The following comparison is certainly not 'fair' but I just had the dmtxread
utility of the libdmtx try my test set of images and it missed 3 of 17 samples and took a whooping 300 times as long compared to my code :).
Upvotes: 1
Reputation: 208
I had similar problem as you but on encoding side. As per my findings Zxing is certainly inferior to Libdmtx. We are using both libraries in house in C++ and Java project.
There is a case when Zxing breaks while generating barcode look at my comments here: https://github.com/zxing/zxing/issues/624
However Libdmtx works flowless. The other free options you have in java world are (they are for encoding):
Upvotes: 1