glassechidna / zxing-cpp

ZXing C++ Library
Apache License 2.0
597 stars 435 forks source link

UPC-E/EAN-8 clash #97

Open NaveenEcon opened 2 years ago

NaveenEcon commented 2 years ago

It is observed that when we try to detect the other ONE-D barcodes (like EAN-13,UPC-A,CODE 128 etc) it is found that UPC-E & EAN-8 were decoding as a false barcodes (I.e. It is not a actual UPC-E/EAN-8 barcode).
I have observed the detailed working of UPC-E algorithm for the false barcode detection. It was completely passing with the algorithm (zxing library)

So this works according to the algorithm, but for us that was actually a wrong data that is being decoded. I am attaching the samples that is being decoded as the false barcodes. Let me know if any way to eliminate the false detection of these barcodes.

MicrosoftTeams-image Here you can see the UPC-E barcode was decoded inside the some other ONE-D barcode (CODE-39) in the frame.
This image shows what text was decoding and at what point it was failing and passing. So here you can see due to 1:1:1 proportion for the START_CODE makes it easier to enter into the detection algorithm (decode middle in zxing lib). So it was completely matching with the algorithm and the ENCODING scheme at some point of time. Even at times if there was no barcodes in the frame the UPC-E type was being decoded due to black, white transitions in the frame.

Image Samples of false barcode detection :

upce_479_300 Image upce_313_210 upce_440_310