qrcode can not readed

74 vues
Accéder directement au premier message non lu

Zheng Luo

non lue,
13 mai 2017, 19:15:4113/05/2017
à zxing
download from https://github.com/zxing/zxing/releases/download/BS-4.7.6/BarcodeScanner-4.7.6.apk,
it work well for most qrcode but this one,can you help me ?thank you very much!
barcode.png

Bas Vijfwinkel

non lue,
14 mai 2017, 00:19:2214/05/2017
à zxing
On Sunday, May 14, 2017 at 8:15:41 AM UTC+9, Zheng Luo wrote:
> download from https://github.com/zxing/zxing/releases/download/BS-4.7.6/BarcodeScanner-4.7.6.apk,
> it work well for most qrcode but this one,can you help me ?thank you very much!

The contrast between the black and green is too small for the decoder to detect the qr code.
If I make it just black and white it works fine.

I don't recall the decoder to do some analysis for determining what the background color might be.
It just assumes a certain amount of contrast between the background and the black color.

barcode.png

Zheng Luo

non lue,
18 mai 2017, 21:39:1418/05/2017
à zxing
在 2017年5月14日星期日 UTC+8下午12:19:22,Bas Vijfwinkel写道:
changed the background can decode ,but the barcode that we have no permission to change,It is customed by factory.can you give me advice to change the background to
white dynamic?

Bas Vijfwinkel

non lue,
19 mai 2017, 02:27:5219/05/2017
à zxing
ZXing converts a color image to a luminance (brightness) image.
The input can be RGB or (inverted)-YUV.
It does this because it wants to detect the differences between light and dark areas.

This is the class for RGB based images :
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/RGBLuminanceSource.java
The constructor of this class does this conversion from RGB to luminance.

Note the comment on line 53 : "Calculate green-favouring average"
So for some reason they amplify the green component so that might be the issue.

In your case reduce or totally leave out the green component.
https://github.com/zxing/zxing/blob/master/core/src/main/java/com/google/zxing/RGBLuminanceSource.java#L51

I don't know how to to that with YUV but it seems green equals a negative U+negative V.

I don't know if the ZXing app gets an RGB or (inverted) YUV image so
maybe apply this fix to the following classes :
PlanarYUVLuminanceSource.java
InvertedLuminanceSource.java
RGBLuminanceSource.java
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message