QR code detection slow

The use case is a PDF document. We transform each pdf page into an image via Aspose Java and check if a qr code is present. QR code detection of the following example page in png takes more than 120 seconds.
qrcode_issue.png (145.0 KB)

long aspStart = System.currentTimeMillis();
BarCodeReader reader = new BarCodeReader("C:\\qrcode_issue.png", DecodeType.QR);
reader.readBarCodes();
System.out.println("Aspose: " + (System.currentTimeMillis() - aspStart));

We also tried some of the following qualitySettings since the image seems to have “Salt-and-pepper noise”.

reader.getQualitySettings().setAllowSaltAndPaperFiltering(true);
reader.getQualitySettings().setAllowDecreasedImage(true);
reader.getQualitySettings().setAllowMedianSmoothing(true);
reader.getQualitySettings().setMedianSmoothingWindowSize(4);
reader.getQualitySettings().setAllowWhiteSpotsRemoving(true);
reader.getQualitySettings().setAllowDecreasedImage(true);

@martin.duerig,

Thanks for the barcode image.

Which version of Aspose.BarCode for Java you are using? I tested your scenario/case with your (barcode) image file using the latest version: Aspose.BarCode for Java v23.6 and it works efficiently and instantly. It takes only a few seconds to process your code.

Could you please try the latest version of the API and let us know if you still find the issue.

1 Like

Dear Amjad, thank you for your feedback.
We were using Aspose.BarCode for Java v20.12
Testing it with v21.10 worked much better.

@martin.duerig,

It is nice to know that the newer version works for your needs well. Please feel free to write us back if you have further queries or comments, we will be happy to assist you soon.