micjahn/ZXing.Net

Don't decode QR_CODE

kkkaktusss opened this issue · 3 comments

Hi, i have a bit question. When I try to decode image, barcodereader can't find a QR_CODE format, but in "https://zxing.org" this type is recoginzed(attach a proof in picture).
My code return EAN_8, UPC_E, but not a QR_CODE.
var reader = new BarcodeReader() { AutoRotate = true}; reader.Options.TryHarder = true; reader.Options.PossibleFormats = new BarcodeFormat[] { BarcodeFormat.QR_CODE, BarcodeFormat.EAN_8, BarcodeFormat.UPC_E }; var result2 = reader.DecodeMultiple(imageMat);
2024-03-19_14-57-53

photo_2024-03-19_14-55-52

Can you help me?

Can you post the QRCode image itself that fails to decode?

i fixed that. Now, i push in zxing crop image and that worked. But anyway, why zxing recognize multiformat, if i push only qr_code type ?

i fixed that. Now, i push in zxing crop image and that worked. But anyway, why zxing recognize multiformat, if i push only qr_code type ?

Well, with the reader.Options.PossibleFormats = new BarcodeFormat[] { BarcodeFormat.QR_CODE, BarcodeFormat.EAN_8, BarcodeFormat.UPC_E }; you explicitly look for EAN_8 as well. The reason you are getting a false positive EAN_8 is because of the quality of the EAN_8 detector. I assume the one used by ZXing.NET is still the same as the one implemented in the original Java ZXing library. I'm the maintainer of the zxing-cpp project and have reimplemented the EAN_8 detector/decoder (among others) which resulted in this specific case in a substantially reduced false positive rate. There is a .NET wrapper available as well: https://www.nuget.org/packages/ZXingCpp