Incorrect recognition

I have a bad image “bad_barcode.png” and a method.

string ReadCode(Bitmap bmp)
{
var br = new BarCodeReader(bmp, BarCodeReadType.Code128);
if (br.Read())
{
return br.GetCodeText();
}
return null;
}

This method return “GP100407t51237110552313” instead of correct value “GP100407051237110552313”.

Is it possible to tell a bad recognition(“ReadCode” return “null”)?


The version is 3.5.0.0

Hi,


Thanks for the inquiry.

Could you please try adding the following recognition hints to your code and check if it gets the correct codetext?

br.SetHints(RecognitionHints.ThresholdHints.AutoCalculateByImage);

I tested at my end with v3.6.1 and I was able to get the correct codetext.

Hi,
Thanks for your reply. But it can not solve my problem, because sometime I got really bad images like “bad_barcode3.png”. I think there is no way to read the correct codetext. But BarCodeReader.Read() returns ‘True’, and the codetext is incorrect.

Is the “Check Character” in code128 used ?

Hi,


Could you please try the latest version 3.6.1? It returns false on this image.

The Code128 symbology is self checking and the check character is used internally.

Hi,

I have tried the version 3.6.1 and got the same result.

Attachments include my test project and a barcode image.

Hi,


I could get the incorrect codetext value with the last attached image and have logged a bug in our system for this (ID: 19266). We will look into it and will inform you when it gets fixed or there is some alternate solution available. Sorry for the inconvenience.

The bug is not fixed in ver3.7.0.0 :frowning:

Hi,

Sorry, we are still working on it. I will update you as soon as I have some more information.

Hi,


Please find the attached beta dll. It can verify checksum during the recognition process using BarCodeReader.ConfirmCheckSum property.

If this property is set to true, the BarCodeReader.Read() method will return true only if the checksum is verified.
If set to false, checksum will not be checked and a wrong value might be detected.

BarCodeReader reader = new BarCodeReader(filename, BarCodeReadType.Code128);
reader.ConfirmCheckSum = true;
while (reader.Read() == true)
{
Console.WriteLine("Codetext: " + reader.GetCodeText());
}
reader.Close();

The issues you have found earlier (filed as 19266) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.