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

Image doesn't parse QR Code #36

Closed
bobjase opened this issue Aug 22, 2017 · 10 comments
Closed

Image doesn't parse QR Code #36

bobjase opened this issue Aug 22, 2017 · 10 comments

Comments

@bobjase
Copy link

bobjase commented Aug 22, 2017

The attached image doesn't successfully read the QR code, even though the identical image has no problem at https://zxing.org/w/decode.jspx
sampleqr4

@micjahn
Copy link
Owner

micjahn commented Aug 22, 2017

I don't know what you have tried but for me it works.
It is important to know, what the java online decoder does in the background. As far as I know it uses the GlobalHistogramBinarizer instead of the HybridBinarizer (or both, not sure) which is used as default in ZXing.Net BarcodeReader class. If the BarcodeReader class uses the GlobalHistogramBinarizer too it will find both codes in the picture.
The main problem is that the HybridBinarizer gives better results for other pictures. If you want the best out of zxing you have to decode a picture twice, once with every binarizer. But it slows down the decoding speed.
So the default for ZXing.Net is the HybridBinarizer. If you have enough CPU cycles free in your target environment you can enhanced the decoding and try to find the codes with both binarizers.

@micjahn micjahn closed this as completed Aug 22, 2017
@bobjase
Copy link
Author

bobjase commented Aug 22, 2017

Thanks for getting back to me.

I downloaded ZXing.Net.Master and built the winforms demo.

There is no combination of settings that will get this to read the QR code (though it does read the barcode).

How do I specify the binarizer?

@bobjase
Copy link
Author

bobjase commented Aug 22, 2017

I just changed the code from

private static readonly Func<LuminanceSource, Binarizer> defaultCreateBinarizer =
         (luminanceSource) => new HybridBinarizer(luminanceSource);

to

private static readonly Func<LuminanceSource, Binarizer> defaultCreateBinarizer =
         (luminanceSource) => new GlobalHistogramBinarizer(luminanceSource);

and it still did not work

@micjahn
Copy link
Owner

micjahn commented Aug 22, 2017

You have to enable the option for multiple barcodes.

@bobjase
Copy link
Author

bobjase commented Aug 22, 2017

it's enabled

@bobjase
Copy link
Author

bobjase commented Aug 22, 2017

@bobjase
Copy link
Author

bobjase commented Aug 22, 2017

I tried toggling "only QR codes" - still no luck

@micjahn
Copy link
Owner

micjahn commented Aug 22, 2017

I do exactly the same and it works. Crazy. Scratching my head.
Are you sure that the project is build correctly after your changes?

@bobjase
Copy link
Author

bobjase commented Aug 28, 2017

I did a clean and rebuild. Same issue

@micjahn
Copy link
Owner

micjahn commented Aug 29, 2017

Can you please try out the attached binary build of the WinForms demo?
The ZIP-Archiv includes the picture from this issue, too.
WindowsFormsDemo_GlobalHistogramBinarizer.zip

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