Frequent false positives decoding Code128

Skip to first unread message

Filip Korpalski

Jan 7, 2019, 5:12:07 AM1/7/19
to zxing

During scanning I am expiriencing alarmingly high rate of false positives in Code128 symbology. False positive output strings appear to be similiar to read barcodes usually with some characters replaced by others.
Device used in tests was Samsung galaxy J3 but appears to be reproduced on other phones.

Examples :

Expected | Read
SA666135543NZ | SA62613/'43'5
SA670704665NZ | SA6707M46{1NW
SA660487825NZ | SAz6/48482/NZ

Lachezar Dobrev

Jan 7, 2019, 8:10:29 AM1/7/19
to Filip Korpalski, zxing
Do you have example images?
It is possible, that you're getting false positives with other
symbologies. Try scanning only for Code-128, avoiding Code-39 and
similar that are known to yields false-positives.

На пн, 7.01.2019 г. в 12:12 ч. Filip Korpalski
<> написа:
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> For more options, visit

Filip Korpalski

Jan 7, 2019, 9:38:00 AM1/7/19
to zxing
Thank you for your response,

Yes I am aware that having other symbologies enabled It could result in false positives but I am sure that those reads come in Code128 symbology. I enclose two screenshots of incorrect reads I had today.
Screenshot_20190107-145657_Barcode Scanner.jpg
Screenshot_20190107-150300_Barcode Scanner.jpg

Lachezar Dobrev

Jan 9, 2019, 8:42:19 AM1/9/19
to Filip Korpalski, zxing
Well, that's … unexpected.
If possible, can you please attach the actual generated code (as an
image, or PDF)? Maybe there is something wrong with the actual
generation phase?
For the longest I've never actually seen a false-positive 128. The
mandatory check-sum should reduce false positives to <1%.

На пн, 7.01.2019 г. в 16:38 ч. Filip Korpalski

Filip Korpalski

Jan 9, 2019, 9:41:39 AM1/9/19
to zxing
I attach our test barcodes, I have reproduced this issue with barcodes generated with other tool too.

Sean Owen

Jan 10, 2019, 11:07:48 AM1/10/19
to zxing
Code 128 does have a weak checksum, a check digit. So false positives should be rare but not impossible. I'd say check that you are encoding a check digit, but I think all of it would decode incorrectly or not at all without it.
You can modify the library to have stricter tolerances when scanning for digits to probably reduce misreads at the expense of more misses. I also haven't really seen Code 128 misreads in my limited experience, so that's odd.
Reply all
Reply to author
0 new messages