zbar icon indicating copy to clipboard operation
zbar copied to clipboard

QR Code not detected

Open pmichalek opened this issue 4 years ago • 8 comments

Attached QR is not detected by zbarimg 0.23. Scan by phone (QRDroid) from screen is OK. QR code image was extracted from PDF. qr

pmichalek avatar Oct 12 '20 17:10 pmichalek

I am currently having the same problem. It appears that whenever i scan an image in with an A4 scanner, the QR Code is never detected. The scan is saved to a PDF by the scanner software. I then convert the PDF file to a PNG file in order to use zbarimg.

I have used various barcode readers on mobile devices on the PNG document to make sure the QR Code is not corrupt and they all read the barcode fine.

I would love to know how to fix this. Can provide sample documents if needed.

jreason avatar Oct 29 '20 12:10 jreason

Same here. This is an example of a QR code which is not detected by zbar: 24

jounathaen avatar Feb 01 '21 10:02 jounathaen

In case it's useful, @pmichalek's image can be made readable by copying all black pixels 1 px to the right and then again copying all black pixels 1 px down: 95773325-8e8f2f00-0cbe-11eb-8bf0-5f81a315becd_padded

EDIT: Or more simply, by filling in the finders: 95773325-8e8f2f00-0cbe-11eb-8bf0-5f81a315becd_filled

Maxdamantus avatar Feb 02 '21 10:02 Maxdamantus

I am able to provide a few more images that zbarimg does not decode, but my iPhone has zero issue detecting.

20210420_103004_Raven_Scan_1 20210420_145413_Raven_Scan 20210421_161807_Raven_Scan

We are scanning documents that we stick a 1"x1" label with a QR Code. Our success rate is fairly good, but every once in a while we also have documents that our software does not process because the QR Code wasn't detected. I am curious why my iPhone can decode these, but zbarimg can't. If there's anything I can do to help, please let me know.

kwrobel avatar Apr 21 '21 21:04 kwrobel

I also tried to recognize scans via QR Codes, and my conclusion was, that QR codes are not reliable enough for recognizing documents. They seem to be rather sensitive about the thickness, shape and orientation of the markers. The reason your phone can recognize them so reliable is, that it has multiple tries. With a standard camera you can scan like 30 images per second and due to the movement of the hand, you'll get a result fairly quickly.

But for a document you have only a single shot. I switched to barcodes, and they are far better recognizable for scans. Maybe there are more fancy kind of codes which also work reliable for scans but I stopped researching there.

jounathaen avatar Apr 22 '21 08:04 jounathaen

just tried/tested and failed to decode a qrcode of a screenshot with zbarimg of zbar-0.23.1 (but works online with zxing.org) qrtest

adeliktas avatar Jan 05 '22 00:01 adeliktas

I use this solution and it helps me: https://stackoverflow.com/questions/69689869/improve-zbarimg-qrcode-recognition?newreg=25681a87a68e4de3baf9f2cd28000883

convert input.png +repage -threshold 50% -morphology open square:1 output.png The important parameter is the morphology one

zeusin avatar Mar 16 '22 10:03 zeusin

@zeusin im afraid this command still does not work for me

qr-code-good.pdf

jreason avatar Mar 18 '22 15:03 jreason