Bar code detection on an image

Hi,

We are using the QR Code at our customer sites. Some of them have printers that produce less that ideal quality print outs and/or the paper has crinkled a bit. So when the users go to scan in the documents (as TIFF images), the QR Code is not always detected.

This is understandable if the image is unreadable, but is there a way for Aspose.BarCode to recognize that there is a bar code present on the page, but it’s “illegible”?

The use case we have is when a user has a stack of documents that they put on the scanner. They want every page that has a QR Code to be the first page of a new document. If there is no QR Code on that page, that page get’s appended to the current document. The problem arises when the Aspose.BarCode software doesn’t recognize any bar codes on a page, even though there is one.

What I would like to do is be able to flag that page as one that has a “problem”. But with the Apsose.BarCode software, it seems to be all or none. But I would like a way for it to determine that, yes there is some type of bar code on the page, but it can’t read it properly.

Is that in the API and I am missing it? If not, can it be added?

Thank you,

Todd

Hi Todd,


Apologies for delayed response.

Current implementation of barcode recognition process has three possible outcomes, they are as follow,

  1. Barcode found, CodeText read correctly
  2. Barcode found, CodeText read incorrectly
  3. Barcode not found

Outcome 3 (BarCode not found) can only occur if the BarCodeReader couldn’t identify the barcode symbology on the image or there isn’t any barcode at all. In your case, there is a QR barcode so I can suggest you to use the advanced recognition settings. Even if your problem persists then please provide some samples for our review.

Meanwhile, I will check if some flag can be set in case of illegible barcode text (a barcode is found but unreadable).

Hi,

I’ve looked at those links before, but I will go back over them to see if there is anything I missed.

But a flag to indicate that a bar code was found, but illegible/unreadable would be great.

I just sent you a private email with the QR Code cropped out of the document I scanned in as a TIFF.

Thank you,

Todd

Hi Todd,


Thank you for providing us your sample file. We are investigating the cause of problem with your provided barcode.

Regarding your original requested feature (flag to indicate that a barcode was found, but illegible/unreadable), I have logged a ticket (id: 32482) in our tracking system to analyse the request and if applicable add it to our roadmap.

We will keep you posted with updates.


Hi again,


Please provide sample of your Java code that you are using to read images.

Thank you,

Hi,

This thread coincides with this one:

BarCodeRecognitionException: Not supported format... For BMP?

Please see the code in that link for what I’ve been doing.

Please let me know if you need anything else.

Thank you for your help,

Todd

Hi Todd,


Thank you for your response.

I believe you have mentioned Tiff file format in your original post. Also the file that you have shared earlier via private message is also of Tiff format. Just to point out that the source code to read barcodes from a Tiff file cannot be same as for reading other formats like Jpeg, Png and Bmp. If you are using the same code for all file formats then please share a working copy of your project for our review.

Regards,

Hi,

We are primarily using TIFF when we do the scans. We are converting the TIFFs to a BufferedImage via ImageIO. The BufferedImage is then passed to the BarCodeReader to get the Code Text.

Here is a sample of the code we are using:

//ImportAttribute is a POJO that get’s passed around that contains data about the image that was scanned in
List attributes = new ArrayList();

//FileUtils is a custom class to determine file types
if(FileUtils.isTiff(file)) {
Iterator readers = ImageIO.getImageReadersBySuffix(“tiff”);
if(readers.hasNext()) {
ImageInputStream imageInputStream = null;
ImageReader imageReader = null;
try {
imageInputStream = ImageIO.createImageInputStream(file);

imageReader = (ImageReader) (readers.next());
imageReader.setInput(imageInputStream);
final int pageCount = imageReader.getNumImages(true);

for(int i = 0; i < pageCount; i++) {
BarCodeReader barCodeReader = null;
try {
BufferedImage bufferedImage = imageReader.read(i);

barCodeReader = new BarCodeReader(bufferedImage, BarCodeReadType.QR);

while(barCodeReader.read()){
//Custom code to take the code text and convert it to a POJO
convertTextToAttributes(barCodeReader.getCodeText(), attributes);
}
bufferedImage.flush();

} finally {
if(barCodeReader != null) {
barCodeReader.close();
}
}
}
} finally {
if(imageReader != null) {
imageReader.dispose();
}
if(imageInputStream != null) {
imageInputStream.flush();
imageInputStream.close();
}
}
}
}

Hi,

Is there any update to this issue? I still would like to see a way for the Bar Code Recognition software to detect that a bar code is on a page, but not readable.

Is there a way for me to follow the status of #32482?

Thank you,

Todd

Hi Todd,


Thank you for your patience.

I am afraid, you can only check the status of the ticket in the left panel of your original thread. At the moment it is “Unresolved”, that means the development team has not provided the required functionality.

Upon checking the details, I have learned that your required feature is scheduled for release with Aspose.BarCode for Java v4.7.0. You will be notified via this thread as soon as the required feature is available for public use.

Regards,

Thank you for the update.

I will check back when change is officially in 4.7.0.

Do you have an ETA?

Thank you.

Hi Todd,


I’ve received response from our development team and like to share with you that our development team is currently working on this issue. I’m very sorry to inform you that it is not feasible for us to provide some ETA of this particular issue due to the underlying complexity of the scenario.

I hope you understand and we really appreciate your cooperation.