Aspose barcode java: very slow and return invalid decoded values

Hi,
We were using ZXing to decode and switched to aspose java lib. Was pretty happy with the results but we have two main issues:

  1. Return values are often wrong
  2. Performance is too slow (~1500ms)

Our application sends images of different types of barcodes, datamatrixes and QRCodes. Hence, we need to use a generic reader to decode each images. Also, image frame are captured through video streaming at a rate of 200ms. Each 200ms, we send a frame of the videostream.

We also understand that aspose will “try” each format and if a value is decoded, it will return it.

We also thought that the returned “confidence” and “quality” attributes would help us distinguish between good and bad value. For intance, we would cherry pick the highest confidence value out of the result[]. But they all have the same confidence value!

For those reason, we have to revert to ZXing with equivalent quality of decoding but at a much faster preformance. We are talking ~ 30ms for ZXing compare to ~1500ms for Aspose.

Can you help? Otherwise, I we will ask for a refund. Thanks

This is our aspose code:

Constructor code (only once):

    License license = new License();
    this.reader = new BarCodeReader();
    QualitySettings qualitySettings = QualitySettings.getMaxBarCodes();
    qualitySettings.setAllowIncorrectBarcodes(false);
    this.reader.setQualitySettings(qualitySettings);
    this.reader.setBarCodeReadType(
            DecodeType.QR,
            DecodeType.DATA_MATRIX,
            DecodeType.CODE_128,
            DecodeType.CODE_93_STANDARD,
            DecodeType.CODE_39_STANDARD,
            DecodeType.CODABAR,
            DecodeType.EAN_13,
            DecodeType.UPCA,
            DecodeType.UPCE
            );
    try {
        ClassLoader classloader = Thread.currentThread().getContextClassLoader();
        license.setLicense(classloader.getResourceAsStream("Aspose.BarCode.Java.lic"));
    } catch (Exception e) {
        log.error(e.getMessage());
    }  

And for each frame:

private BarCodeResult getResult(BufferedImage image) {
    reader.setBarCodeImage(image);
    BarCodeResult[] results = reader.readBarCodes();
    return results[0];
}

@erick.audet,

Thanks for the sharing details and sorry for the issues you encountered.

We would love to evaluate your issues, so we request you to kindly share some sample barcode images that you are reading via Aspose.BarCode for Java API. Also, if you do not specify those quality settings in code, does it make any difference regarding performance especially? For your information, the quality of the barcode image also matters a bit. Images with low quality might not be retrieved efficiently to scan barcodes.

Like I wrote, images are processed at a rate of 200ms. To capture an image returning the wrong value is possible but would require source code modification. Otherwise, a perfectly still image will most likely never return a wrong value. I have unit testing that can proove that. Aspose is completely idempotent with still images but not during image streaming. Are you sure you need this?

Also, I remind you that even with a still and perfect image, aspose taks ~300-1500ms to process.

QualitySettings MaxBarCodes is created for special modes and gives additional 0.3% of quality. In main cases Normal quality gives good results.

[quote=“erick.audet, post:1, topic:238997”]
DecodeType.CODE_93_STANDARD, DecodeType.CODE_39_STANDARD[/quote]

“STANDARD” does not decode extended codetext. As an example, encoded codetext in Code 39 “{some}” will be decoded as “%P+S+O+M+E%R”

Alexander, what are saying exactly? That I should remove CODE_93 and CODE_39 ?

No You should replace it with “EXTENDED” version. Splitting to “STANDARD” and “EXTENDED” versions of Code 39 and Code 93 is from legacy compatibility, may be we need to remove this or rename.

Also you should use Normal Quality Settings, other modes should be used in special cases and are not fully developed (some of them from legacy code).

Hi , here is the log showing elapse between zxing and aspose.
Logs:

09:45:18.747 [main] DEBUG c.c.m.searchms.services.CodecService -  *** DECODE Aspose Code *** CodecDto{content='630832641111', txUuid='null', codeType='BARCODE', hints='null', asError=false}
09:45:18.753 [main] DEBUG c.c.m.searchms.services.CodecService -  *** DECODE *** Aspose elapse: 7793 ms
09:45:18.753 [main] DEBUG c.c.m.searchms.services.CodecService -  *** DECODE Zxing Code *** CodecDto{content='630832641111', txUuid='null', codeType='BARCODE', hints='null', asError=false}
09:45:18.753 [main] DEBUG c.c.m.searchms.services.CodecService -  *** DECODE *** Zxing elapse: 250 ms

The image Barcode-Bottle v.jpeg (132.2 KB)

Aspose.Barcode is created for documents with low quality recognition for this requirements it works well. We did not optimize or plan it for mobile recognition, this situation will be solved but this takes couple of years to make hard methods optional and create mobile quality preset.

In this situation, if you need speed on mobile devices, at this time Aspose.Barcode library cannot provide this for you.