Search code examples
javabarcodezxingdatamatrix

Libdmtx vs ZXing for DataMatrix Decoding?


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!


Solution

  • 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):

    • barcode4j
    • OkapiBarcode