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

Public Attributes

const NONE = 0
 
const MODERATE = 80
 
const STRONG = 100
 

Detailed Description

Contains recognition confidence level

This sample shows how BarCodeConfidence changed, depending on barcode type

Moderate confidence

$generator = new BarcodeGenerator(EncodeTypes::CODE_128, "12345");
$generator->save("test.png");
$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::CODE_128));
foreach($reader->readBarCodes() as $result)
{
print("BarCode Type: ".$result->getCodeTypeName());
print("BarCode CodeText: ".$result->getCodeText());
print("BarCode Confidence: ".$result->getConfidence());
print("BarCode ReadingQuality: ".$result->getReadingQuality());
}

Strong confidence

$generator = new BarcodeGenerator(EncodeTypes::QR, "12345");
$generator->save("test.png");
$reader = new BarCodeReader("test.png", null, array(DecodeType::CODE_39, DecodeType::QR));
foreach($reader->readBarCodes() as $result)
{
print("BarCode Type: ".$result->getCodeTypeName());
print("BarCode CodeText: ".$result->getCodeText());
print("BarCode Confidence: ".$result->getConfidence());
print("BarCode ReadingQuality: ".$result->getReadingQuality());
}

Member Data Documentation

◆ MODERATE

const BarCodeConfidence::MODERATE = 80

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.ReadingQuality

◆ NONE

const BarCodeConfidence::NONE = 0

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

◆ STRONG

const BarCodeConfidence::STRONG = 100

Recognition confidence which was confirmed with BCH codes like Reed–Solomon. There must not be errors in read codetext or fake recognitions