Free Support Forum - aspose.com

Problems decoding qrcode (java version- tested with 1.9.0 and 2.1.0)

Hi,

i need decoding qrcode inside this image http://asp.rds-software.com/asptest/downloaded/scan.jpg

Fragment code of my app is this

BufferedImage image;
try {
image = ImageIO.read(new File(file));
} catch (IOException ex) {
throw new CannotDecodeException("Cannot open image file", ex);
}
if (image == null) {
throw new CannotDecodeException("Cannot open image file", new NullPointerException(file));
}

BarCodeReader reader = new BarCodeReader(image, BarCodeReadType.QR);
reader.SetHints(RecognitionHints.ImageBinarizationHints.Grayscale());
Vector vResult = new Vector();
while(reader.read())
{
vResult.add(reader.getCodeText());
}
return (String[])vResult.toArray(new String[0]);

BarCodeReader not decodes qrcode.

Reducing image size of 25% or 50% decoder recognize qrcode, but workaround is not acceptable by the end user !!!

Thanks

Hi,


Thanks for considering Aspose.

Could you please use RecognitionHints.ImageBinarizationHints.MedianSmoothing() in SetHints() method. I can decode the barcode and find the codetext by using MedianSmoothing.