Issues with reading QRCodes from Image

Evaluating your barcode library and having some issues with recognizing the barcodes.

The library seems to know there are barcodes but not that they are QR codes, so the text I get back does not make sense.

I am using PossibleBarCode[] barcodes = reader.getAllPossibleBarCodes();

Example QR Code.png (6.1 KB)

Any help would be greatly appreciated.

@jakrzysztow,

We have evaluated the sample input barcode image shared by you. We are unable to reproduce the issue at our end. We have used the latest version of the API. Sample code snippet that we used to recognize the barcodes and the output is given below for your reference.

CODE:

using (Aspose.BarCode.BarCodeRecognition.BarCodeReader reader =
            new Aspose.BarCode.BarCodeRecognition.BarCodeReader(@"Example_QR_Code.png") 
)
{
        int iCount = 0;
            while (reader.Read())
            {
                //Get code text by passing TRUE to get the Barcode along with checksum value
                Console.WriteLine("{0}:: {1}", reader.GetCodeType(), reader.GetCodeText());
                iCount++;
            }

            Console.WriteLine("Total barcode found:   " + iCount.ToString());
}

OUTPUT:

QR:: A
QR:: B
QR:: C
QR:: Retouch
QR:: Review
QR:: D
QR:: E
QR:: F
QR:: G
QR:: H
QR:: I
QR:: 10007
QR:: J
QR:: K
QR:: L
Total barcode found:   15

I need to use your Java api, not your .NET api. This needs to run on a Mac as well as a PC.

@jakrzysztow,

Following is the Java equivalent code:

CODE:

com.aspose.barcode.barcoderecognition.BarCodeReader reader = new com.aspose.barcode.barcoderecognition.BarCodeReader("Example_QR_Code.png");

int iCount = 0;
    
    while (reader.read())
    {
        System.out.println(" codetext: " + reader.getCodeText());
        iCount = iCount + 1;
    }
    System.out.println("Total barcode found  : " + iCount);

Perfect!

Thank you!

@jakrzysztow,

Thank you for your feedback. Feel free to contact us in case of any query or comments.

We have an image that is taking around 20 plus seconds to get the barcodes.

Any ideas?

MultipleQRCodesSample.jpg (282.3 KB)

@jakrzysztow,

We have logged the information under an investigation ticket with ID BARCODEJAVA-395. Our product team will further look into it. We will update you here once there is some information available in this regard.

Any status on this?

@jakrzysztow,

Working on this issue is in progress. We have asked our product team to share updates. We will update you here once there is some information available in this regard.

@jakrzysztow,

We have further investigated the issue. It was found that barcode is over 5MPx. Secondly, if we try to recognize the barcode without specifying the barcode type which is QR in this case will take long time.Because API will try to find all types of barcode. Please try again by specifying the barcode type alongwith latest version of the API. It will not take two to three seconds to recognize the QR barcodes. Sample code snippet and output is given below for reference.

CODE:

    String fileName = "MultipleQRCodesSample.jpg";
    int iCount = 0;
    BarCodeReader reader = new BarCodeReader(fileName, DecodeType.QR);
    while (reader.read())
    {
        System.out.println("codetext: " + reader.getCodeText());
        iCount = iCount + 1;
    }
    System.out.println("Total barcode found  : " + iCount);

OUTPUT:
codetext: PKG-F
codetext: PKG-E
codetext: PKG-D
codetext: PKG-C
codetext: PKG-B
codetext: PKG-A
codetext: Other
codetext: PKG-K
codetext: PKG-J
codetext: PKG-I
codetext: PKG-H
codetext: PKG-G
codetext: ST12385
Total barcode found : 13