Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
Dynamsoft Barcode Reader APIs for you to get the additional barcode information besides barcode value. The result is stored in the struct LocalizationResult
and struct ExtendedResult
.
This article offers two examples about how to get barcode rotation angle and how to get barcode confidence.
To learn more about what additional barcode information you can get please see struct LocalizationResult
and struct ExtendedResult
.
Dynamsoft Barcode Reader SDK is able to detect barcodes at all angles. The SDK is also able to return the angles of the barcodes decoded. The result is stored in the struct LocalizationResult
.
The following illustrations will show how the angle is calculated for different barcode types:
OneD Barcode
QR Code
Data Matrix
Aztec
Maxicode
The following code snippet shows how to get the rotation/skew angles of the barcodes decoded by the SDK:
TextResultArray* paryResult = NULL;
CBarcodeReader reader;
reader.InitLicense("put your license key here");
reader.DecodeFile("put your image file full path here", "");
reader.GetAllTextResults(&paryResult);
printf("%d total barcodes found. \r\n", paryResult->resultsCount);
for (int iIndex = 0; iIndex < paryResult->resultsCount; iIndex++)
{
printf("Result %d\r\n", iIndex + 1);
printf("Barcode Angle:%d \n", paryResult->results[iIndex]->localizationResult->angle);
}
CBarcodeReader::FreeTextResults(&paryResult);
The score of recognition confidence could measure the reliability of a recognized result. The higher the score, the more precise the results are. We could obtain confidence result from struct ExtendedResult
. The following code snippet shows how to get the confidence of the barcodes decoded by the SDK:
TextResultArray* paryResult = NULL;
CBarcodeReader reader;
reader.InitLicense("put your license key here");
reader.DecodeFile("put your image file full path here", "");
reader.GetAllTextResults(&paryResult);
printf("%d total barcodes found. \r\n", paryResult->resultsCount);
for (int iIndex = 0; iIndex < paryResult->resultsCount; iIndex++)
{
printf("Result %d\r\n", iIndex + 1);
printf("Barcode Confidence : %d \r", paryResult->results[iIndex]->results[0]->confidence);
CBarcodeReader::FreeTextResults(&paryResult);
latest version