dlenski / python-zxing

python wrapper for the ZXing barcode library
GNU Lesser General Public License v3.0
123 stars 37 forks source link

How to change binarizer #39

Open Fellow-Bennse opened 4 months ago

Fellow-Bennse commented 4 months ago

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.

dlenski commented 4 months ago

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.

Fellow-Bennse commented 3 months ago

@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!