Free Support Forum -

Strange Barcode read result

Dear support team,
When reading the barcode (type: Code128) from the attached .tif file (within the zip file) I get wrong and strange results (“UERG0(0F’4F7&”), but it should be “UERG010154276”. When splitting the page image in smaller regions, reading the barcode works. Which options I have to set to get the right barcode result reading the whole page? (802.3 KB)

The code part I use is (I
// fileName is he path to the physical .TIF file (within the attached zip file)
using (Stream oStreamRead = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read, 4096))
Image img = Image.FromStream(stream);
using (Bitmap fullBitmap = new Bitmap(img))
// fullBitmap.Save(Path.Combine(Path.GetTempPath(), tmpFile)); // TODO Robert: kann in der Endausbaustufe wieder entfernt werden
using (BarCodeReader reader = new BarCodeReader(fullBitmap, GetDecodeTypes(settings)))
while (reader.Read())
bc = new AsposeBarcode(settings, reader, page);
// result is: UERG0(0F’4F7& and not UERG010154276

Kind regards,

We have observed the issue where wrong value is read from the barcode and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:
BARCODENET-37714 - Wrong value read from barcode

Code128 barcode is high density 1D barcode which was developed in 80-th as replacement of 2 of 5 codes. Because this barcode has more density then other barcode it requires checksum by default which must reduce recognition errors. Checksum isn’t to strong but in main cases it is enough to make recognition errors rate low. Main disadvantage of Code128 that it doesn’t have information for restoration as 2D barcodes do. This leads to situation when in low quality image we cannot recognize barcode segment correctly because on low quality images some barcode segments can have multiple recognition results.

The barcode is a row of letters which are represented by the group of barcodes and some of these lettesr on low quality images are recognized but recognized with multiple variants. In normal recognition mode this row is checked by checksum and drop out if checksum is wrong.

In increase the recognition quality we create decision algorithm which recognize low quality barcodes by creating decision tree from these variants and checks variants sequences by checksum. In most of cases (more then 95-98%) it allows to recognize barcodes correctly which mustn’t be recognized. But in 2-5% cases it recognizes with error.

I started project to make recognition process more customizable and give user ability to tune these engine modes manually. So, the decision tree algorithm could be disabled and hard modes also could be disabled. This will allow to increase performance on high quality images and decrease false positive recognition. Currently this improvement isn’t implemented, but I think it will be implemented in 2021.

Problem is related with barcode segment pickup algorithm.

We have two recognized values:
from RestorationType.BresenhamOtsa (restored)
from RestorationType.WhiteErosion (correct high quality).
But BresenhamOtsa in our algorithm is more valuable even with slightly lower quality.