Hello,
We have an application which is reading a poorly printed Code128 barcode with the Aspose package in Java. The problem is that the barcode returned is 90% of the time incorrect which shouldn’t happen because the checksum should be stopping this. How is it managing to return so many bad reads. The code is as follows:
BarCodeReader reader = new BarCodeReader(OpenCVUtils.convertToBufferedImage(iplImage), typeLookup.get(OneDBarcodeFormat.CODE_128));
reader.setStripFNC(true);
reader.setChecksumValidation(ChecksumValidation.ON);
reader.setQualitySettings(QualitySettings.getHighQuality());
reader.getQualitySettings().setAllowIncorrectBarcodes(false);
reader.setChecksumValidation(ChecksumValidation.ON);
while (reader.read())
{
codeText = reader.getCodeText();
}
if (StringUtils.isBlank(codeText)) {
throw new BarcodeReadException(“No code read”, Reason.NOT_FOUND);
}
The basic issue here is that I can’t trust Aspose if it returns bad codes even with a checksum. Why doesn’t the checksum kick out the bad codes?
An example image is attached; note that we rotate it before it is read by aspose (using OpenCV) so that the code is horizontal.
bad code.png (528.8 KB)
Cheers,
Neil