Error Reading ean8 and ean13 bar code

128 views
Skip to first unread message

Mister ch

unread,
Feb 1, 2021, 5:47:55 AM2/1/21
to zxing
Hello,

i am trying to read ean 8 and ean 13 barcodes in continuous mode.

Sometimes everything goes well and most of the time I receive an incorrect barcode in the list of scanned codes.

I tried with version 3.4.1 and other old versions => same things.

is there a solution?
If not, is it possible to ignore the bar codes if it is not clear or poorly read and only accept codes that are interpreted correctly?

Sean Owen

unread,
Feb 1, 2021, 6:17:50 AM2/1/21
to zxing
These can be somewhat easy to misread as they have a weak checksum. Try only scanning for these two formats.
Heh if it could magically know whether a barcode scan was 'real' or not (aside from checksum) there would be no misreads! how would it know?

Mister ch

unread,
Feb 1, 2021, 8:13:43 AM2/1/21
to zxing
First, thank you for your reply

yes i have this configuration:
            mCodeScanner.setFormats(Arrays.asList(BarcodeFormat.EAN_8, BarcodeFormat.EAN_13));

I want to know if we have a crisp and clear picture from camera, is there a risk of having the wrong barcode?


Sean Owen

unread,
Feb 1, 2021, 9:17:00 AM2/1/21
to zxing
There's not a fool-proof way to avoid it. If you know the region of the image containing the barcode already, crop to that region.
Black-and-white images are worse than grayscale/color.
If you know any more about what barcode you are expecting at the application level, you can reject scans that don't match.

Mister ch

unread,
Feb 1, 2021, 10:56:00 AM2/1/21
to zxing
i tried with your advice and crop the image but same results

I read that if we lower the resolution of the camera to 640x480, that's fine for most cases.
is it correct ? 

if true how can i implement this?

Sean Owen

unread,
Feb 1, 2021, 10:58:39 AM2/1/21
to zxing
Could be. You don't need a lot of resolution. Sometimes noise and artifacts at high resolutions actually interfere. Downsampling works a bit like a filter.
Reply all
Reply to author
Forward
0 new messages