piderman314 / bardecoder

Detect and decode QR Codes, written in 100% Rust.
MIT License
275 stars 34 forks source link

Can't detect this qr code even with manually drawn features #32

Closed jounathaen closed 3 years ago

jounathaen commented 3 years ago

I have this QR code which can't be detected:

82

The candidates debug Image looks as follows:

candidates

Ok, then let's repaint the "corner boxes" with pixel-perfect ones in a paint programm:

test

But still no success... :disappointed:

candidates

The code is 1:1 the example from the README.md

BTW: zxing and zbar fail for the unedited code but succeed with the hand drawn corner features

piderman314 commented 3 years ago

I think the problem with this image is that the black parts are too wide. In almost all instances, including the locator patterns, the black squares are about 7-8 pixels wide, while the white squares are 5-6 pixels wide. This throws off the algorithm because it expects the white and black parts to be the same size. The algorithm has some tolerances built-in, but we're looking at over 25% bigger black squares, which is too much.

jounathaen commented 3 years ago

Hmmm, that might be the reason. A bit dissatisfying because I can't really change the input but then I'll have to find some other way... Feel free to close this if you think this case is out of scope :slightly_smiling_face:

piderman314 commented 3 years ago

I'm sorry I can't help you with this. Unfortunately sometimes QR Codes are created that do not adhere to the specs, which makes it difficult or impossible to read them properly.