QR code not recognized in PDF


I’m processing scanned documents in PDF format with QR barcode labels on them. The barcodes were generated and printed using Aspose.Barcode.NET.

Now and then I have cases where the barcode is not recognized even though there is no reason for it (that I can see) and when I open the PDF in Adobe Reader and hold my mobile phone (with the Zxing barcode app) to the screen it decodes the barcode just fine.

Just got my hands on another such case and I’ve attached the PDF.

I
have tried with Aspose.Pdf.Kit (like in the example available here) or by converting them with ImageMagick/Ghostscript to a GIF (or TIFF) and processing that. I’ve also tried a bunch of different combinations of hints to the reader. Nothing works. I’m using Version 4.0.0.

Any ideas?


Hi,

Thank you for inquiry.

I was able to reproduce the issue at my end with the sample document. I have logged this bug (ID: 27855) in our system. We will look into it and will inform you here when it gets resolved. Sorry for the inconvenience.

Hi,

Any news on this one?

I’m still having a steady number of scanned documents where the barcodes are not recognized. And I’m having a hard time explaining to the client why it isn’t working because there’s doesn’t seem to be anything (obviously) wrong with his documents.

I can provide more sample documents if that would help things along.

Hi,

Sorry, we are still working on it. It would be helpful for us, if you could send some more problematic barcode documents for our debugging and analysis.


Hi,

I’ve attached another 4 sample documents.

Send me a message if you need more.

Hi,

Thanks for the samples. I have forwarded these to the development team for the analysis.


Hi,

can you give me some kind of time frame for a solution to this problem?

I reported it almost two months ago and I have annoying people (read: users) reminding me a couple times a week that the problem still occurs. It would help if I could give them a date for a fix to get them off my back.



Hi,

I will try to get an ETA for this issue and will update you shortly.

Hi,

We are working on this issue and hope to provide a solution till end of this month.


Hi,

any news on this one?

Hi,

We will get back to you soon with more information, sorry for the inconvenience.

Hello seke,


Please try the beta version from the attachment.


Code example:
[1. Using NeatImageFilter]


NeatImageFilter neatImageFilter = new NeatImageFilter();
Rectangle rect = new Rectangle(1260, 100, 510, 500);
Bitmap bmp2 = neatImageFilter.Apply(bmp,rect);
BarCodeReader reader = new BarCodeReader(bmp2, BarCodeReadType.QR);
while(reaer.Read())
{
......
}


[2. Using RotationAdjustmentFilter]


RotationAdjustmentFilter rotationAdjustmentFilter = new RotationAdjustmentFilter();
Rectangle rect = new Rectangle(1260, 100, 510, 500);
Bitmap bmp2 = rotationAdjustmentFilter.Apply(bmp,rect);
BarCodeReader reader = new BarCodeReader(bmp2, BarCodeReadType.QR);
while(reaer.Read())
{
......
}

Both NeatImageFilter and RotationAdjustmentFilter will fix the image, you can choose one just as you like.

Thanks


Hi,

I did some tests and I’ve seen definite improvement when using the NeatImageFilter (tho it slows down processing significantly - since I don’t know where on the page the barcode will be, I have to apply the filter to the whole image). The RotationAdjustmentFilter doesn’t seem to be doing much for me tho.

Another interesting bit is that with ImageMagick/GhostScript (rendering at 300dpi) and the NeatImageFilter all six test cases that I submitted are now recognized, but when I use Aspose.Pdf.Kit (as per example from the documentation) only two of the six are recognized.
We are considering switching the processing for PDFs from external programs (usually ImageMagick/GhostScript) to Aspose.Pdf, but for that it has to work at least as well.

Next I tried a bigger sample size: 76 PDFs that previously failed. Rendered with ImageMagick/GhostScript (at 400dpi) + NeatImageFilter 56 of them were recognized (tho it seems the barcode was recognized incorrectly in a couple cases).

Another thing I noticed: I seem to be getting ‘Invalid argument’ exceptions if additional hints are set after applying the NeatImageFilter.

caught exception: System.ArgumentException: Ungültiger Parameter.
bei System.Drawing.Image.get_Width()
bei Aspose.BarCodeRecognition.?.get_?()
bei Aspose.BarCodeRecognition.?..ctor(? r, ? s)
bei Aspose.BarCodeRecognition.BarCodeReader.?.?()
bei Aspose.BarCodeRecognition.BarCodeReader.?.?()

What exactly does the strength parameter of the NeatImageFilter do and what are valid values for it?

Hello seke,

Our developers were looking into the 'Invalid argument' exceptions, I will keep you update if any progress.

About the Strength parameter, the attached image shows how it works.

Thanks

I have the same problem and i'm looking for the NeatImageFilter class.

But I don't find it, ever in the last version of Aspose.BarCodeRecognition. Could you send me this beta version ?

Thx

Hi,

NetImageFilter class is available in the latest version, Aspose.BarCode for .NET 4.2.

Hi,

I'm sorry but i definitively don't find the NeatImageFilter Class in this version.

Could you send me the beta version, please.

Thanks

Hi,

Please find the sample application. The dll is also present in bin\debug folder. You may also get it from “bin\netx\Aspose.BarCodeRecognition.dll”.

The issues you have found earlier (filed as BARCODENET-27855) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.