python-zxing icon indicating copy to clipboard operation
python-zxing copied to clipboard

How to change binarizer

Open Fellow-Bennse opened this issue 1 year ago • 2 comments

Hey there!

when using zxing for QR-Code extraction it can happen that it fails to extract due to the picture/document being of poor quality and the binarizer reading the QR-Code as black square.

I read in the docs that there is a "hybrid-binarizer" that should be working better in such cases but I fail to find the information on how to swap to that binarizer. Would appreciate some help on this matter.

Fellow-Bennse avatar Jun 03 '24 06:06 Fellow-Bennse

I read in the docs that there is a "hybrid-binarizer"

This? https://zxing.github.io/zxing/apidocs/com/google/zxing/common/HybridBinarizer.html

I fail to find the information on how to swap to that binarizer.

This Python package interfaces with the Java ZXing library entirely via its command-line interface.

If you want to be able to switch the binarizer in python-zxing, you should start by contributing a change to ZXing's CommandLineRunner.java to allow setting the binarizer from the CLI. Feel free to link it to this issue.

It wouldn't be the first time that we've sent improvements upstream.

dlenski avatar Jun 03 '24 21:06 dlenski

@dlenski ah so it's not in the python lib implemented as of now? I see. if I get to a point where I might have time for it I guess I'll look into it. Appreciate the Information!

Fellow-Bennse avatar Jun 06 '24 07:06 Fellow-Bennse