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());
}
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 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?
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.
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.
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.
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.