googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.92k stars 1.73k forks source link

Wrong detection in code values #163

Open ghost opened 7 years ago

ghost commented 7 years ago

This is the content of the codeBar to be read: BLR16001692. But The camera return this value: B%%'60(1692

What could be the reason of this error please?

The type or format of barcode which I'm using is the same always: 3 characters+ 8 digits ex: BLR12345678. I'm using code 128 for generating barcodes.

I get the error above only with the Huawei TIT-U02, with another device like Huawei-G730 I get a long series of digits like 2567476459569

pchx-zz commented 7 years ago

It's hard to say why the wrong value is getting read without a sample image of the barcode in question. It's possible that the camera resolution you are using is too low.

ghost commented 7 years ago

@pchx I added a picture of a barcode and a QR code which I used for test. Besides I'm testing with a Huawei TIT-U02 device (back camera: 13Megapixel).

screen shot 2016-12-13 at 16 00 34

screenshot_2016-12-13-15-33-47

pchx-zz commented 7 years ago

Try rendering the Code 128 barcode at a greater width.

ghost commented 7 years ago

I get the same result even with a greater width, I'm wondering if it can be related particularly to the Huawei TIT-U02 device because I'm not getting this problem with other devices which have a lower camera resolution.

pchx-zz commented 7 years ago

Possible, though unlikely. You can try loading a Bitmap from an image file and passing that into BarcodeDetector (to eliminate camera issues as a potential source of the error) and running that on your devices. If you can reproduce the inconsistent result value with an image, add it to this issue.