Aspose.Barcode for Python via Java Generation and Recognition API docs
BarCodeConfidence Class Reference

Contains recognition confidence level. More...

Inherits Enum.

Static Public Attributes

string MODERATE = "80"
 Recognition confidence of barcode (mostly 1D barcodes) with weak checksumm or even without it. More...
 
string NONE = "0"
 Recognition confidence of barcode where codetext was not recognized correctly or barcode was detected as posible fake. More...
 
string STRONG = "100"
 Recognition confidence which was confirmed with BCH codes like Reed–Solomon. More...
 

Detailed Description

Contains recognition confidence level.

This sample shows how BarCodeConfidence changed, depending on barcode type

#Moderate confidence
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.CODE_128, "12345")
generator.save(self.image_path_to_save, Generation.BarCodeImageFormat.PNG)
reader = Recognition.BarCodeReader(self.image_path_to_save, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.CODE_128])
for result in reader.readBarCodes():
print("\nBarCode Type: " + result.getCodeTypeName())
print("BarCode CodeText: " + result.getCodeText())
print("BarCode Confidence: " + str(result.getConfidence()))
print("BarCode ReadingQuality: " + str(result.getReadingQuality()))
#Strong confidence
generator = Generation.BarcodeGenerator(Generation.EncodeTypes.QR, "12345")
generator.save(self.image_path_to_save, Generation.BarCodeImageFormat.PNG)
reader = Recognition.BarCodeReader(self.image_path_to_save, None, [Recognition.DecodeType.CODE_39, Recognition.DecodeType.QR])
for result in reader.readBarCodes():
print("\nBarCode Type: " + result.getCodeTypeName())
print("BarCode CodeText: " + result.getCodeText())
print("BarCode Confidence: " + str(result.getConfidence()))
print("BarCode ReadingQuality: " + str(result.getReadingQuality()))

Member Data Documentation

◆ MODERATE

string MODERATE = "80"
static

Recognition confidence of barcode (mostly 1D barcodes) with weak checksumm or even without it.

Could contains some misrecognitions in codetext or even fake recognitions if is low

See also
BarCodeResult.getReadingQuality()

◆ NONE

string NONE = "0"
static

Recognition confidence of barcode where codetext was not recognized correctly or barcode was detected as posible fake.

◆ STRONG

string STRONG = "100"
static

Recognition confidence which was confirmed with BCH codes like Reed–Solomon.

There must not be errors in read codetext or fake recognitions