PDF417 barcode reading issue

Hi,

I have an issue with the aspose barcode reader library.
It takes a lot of time to find a barcode (30-45 seconds) and it consumes a lot of memory too around 800MB - 1GB of memory).

Maybe you guys have some hints on how to improve this.

My code is this

BarCodeReader reader = new BarCodeReader(file.getAbsolutePath(), DecodeType.PDF_417);
      reader.setQualitySettings(QualitySettings.getMaxBarCodes());

      for (BarCodeResult result : reader.readBarCodes()) {
        System.out.println("CodeText: " + result.getCodeText());
        System.out.println("Symbology type: " + result.getCodeType());
        System.out.println("Percentage recognition: " + result.getReadingQuality());
      }

barcode_not_read_1654259282216_141421056659050501249399593.jpg (2.1 MB)

Without the quality setting QualitySettings.getMaxBarCodes() the barcode is not recognized but the result is a lot faster (5-7 seconds). Memory consumption is a bit smaller.

I also tried to binarize the images but recognition gets worse if I do that.

I’ve attached the problematic barcode

Thank you

@bogandy,

I did test your scenario/case using your barcode image file. It takes approx. 30 seconds to capture the barcodes in the image on my end. I guess considering the quality of the image, the time consumption is ok. QualitySettings.getMaxBarCodes() will make sure to extract/detect every possible barcodes (even with low quality) so it will sacrifice the time consumption (taken) and consume more memory.

I saw that there are a lot of quality settings.
Could you maybe suggest something (recommended maybe for PDF417 barcodes) so that the time/memory can be lowered?

@bogandy,

We need to evaluate it thoroughly. I have logged a ticket with an id “BARCODEJAVA-1367” for your issue. We will check if we could devise/use some attributes to lower down time and memory cost. Alternatively, we could enhance the APIs to detect barcodes with efficiency from deteriorated quality image. We will look into it soon.

Once we have an update on it, we will let you know.

alright. thank you
Can’t wait for your feedback :slight_smile:

@bogandy,

Please spare us little time to analyze your issue in details first.
Once we have any new information available, we will update you.

sure. thanks

Hi

is there any progress on this?

Thanks

@bogandy,

There is no update yet. We will check and get back to you soon to share either an ETA for your issue or updates/workaround to cope with your issue.

We are sorry for any inconvenience caused!

@bogandy,

The issue is blocked by relevant .NET issue (logged as “BARCODENET-38254”). The temporary solution to cope with it is the size of the image can be decreased 3-4 times. The resolution should be 300-600 dpi. Please note, after resolving the issue this will happen automatically.

Alright. Thank you.
Will I be notified in this ticket when the .NET issue BARCODENET-38254 will be solved?

@bogandy,

We have attached the ticket id with this thread as well, so once the ticket (“BARCODENET-38254”) is resolved, we can update you.

Alright. Thank you

@bogandy,

You are welcome.

Any news here?

@bogandy,

The relevant issue “BARCODENET-38254” is resolved. Could you try using
Aspose.BarCode for Java 22.10 if performance (reading time and memory cost) is good for you.

.Net version recognizes the image in normal quality mode.

QualitySettings.getMaxBarCodes - is special mode and it will be all time slow and require huge amount of memory.

@bogandy,

We are pleased to inform you that your issue (logged earlier as “BARCODEJAVA-1367”) has been resolved. The fix related to the quality/enhancement will be added in the next release of Aspose.BarCode for Java v22.12 which is due before the end of this month or in next month early.