Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognizes the UPC_E format on the Qr_CODE #576

Open
kkkaktusss opened this issue Jun 18, 2024 · 5 comments
Open

Recognizes the UPC_E format on the Qr_CODE #576

kkkaktusss opened this issue Jun 18, 2024 · 5 comments

Comments

@kkkaktusss
Copy link

Hi. I use Zxing.Net together with OpenCV.V4. Convert from pdf file to Bitmap, and then from Bitmap to Mat and submit Mat to reader. I'm trying to decode the QR_CODE, but the reader only finds UPC_E. I tried to recognize it by the picture on the website zxing.org , but it doesn't find any barcode at all. Is there any way to fix it? The code and QR_CODE are attached below.
2024-06-18_19-14-51
2024-06-18_19-16-08
crop
2024-06-18_19-17-48

@SanKumSan
Copy link

SanKumSan commented Jun 19, 2024

Hello,
Zxing tries to detect and decode barcode/qrcode/any other formats of the codes in your given Rectangle section.

Zxing detects something which is not barcode or qrcode but resembles or looks like barcodes or qrcodes. Can be text which resembles like barcode or b/w logo which might look like barcode for ZXing and others, and due to this it decodes something from this False Positive detection.

Try to draw what it has found and you will get more info on what it detected and decoded.
NOTE : these are my observations found from using ZXing for Net.

Also, you could also use and try to decode again with MultiFormatReader, and not just Simple BarcodeReader.

var source = new BitmapLuminanceSource(bitmap);     
var binaryBitmap = new BinaryBitmap(new HybridBinarizer(source));
            var reader = new MultiFormatReader();
            var hints = new Dictionary<DecodeHintType, object>();
            hints.Add(DecodeHintType.TRY_HARDER, true);
            reader.Hints = hints;

            var scan = reader.decode(binaryBitmap, hints);

@kkkaktusss
Copy link
Author

kkkaktusss commented Jun 19, 2024

I tried this code, but it didn't help. Now reader has started to define the qar code as PHARMA_CODE.
2024-06-19_16-31-48

@SanKumSan
Copy link

Hello,
If possible please share the image file and not just the rectangular section and I would try to decode and get back to you.

Also, post what exactly you want to decode from this, if you know what it contains and if not confidential.

@kkkaktusss
Copy link
Author

There should be 5 fields in the QR_CODE. I am attaching the file below.
forIssue.pdf

@SanKumSan
Copy link

SanKumSan commented Jun 20, 2024

Hello,
I have tried to decode and decoded UPC_E value, and I think it is not correct.

  1. Check on how your pdf is generated.
  2. Check what kind of error correction is encoded with the QRcode (Low, Medium or High) .
  3. If it is converted from jpg/tiff to pdf then the compression in the image may cause decoding failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants