Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

How-to Guides - Get Additional Barcode Information

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.

Get Barcode Rotation Angle

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:

  1. OneD Barcode
    OneD Barcode Rotation Angle

  2. QR Code
    QR Code Rotation Angle

  3. Data Matrix
    Data Matrix Rotation Angle

  4. Aztec
    Aztec Rotation Angle

  5. Maxicode
    Maxicode Rotation Angle

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);

Get Barcode Confidence

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);

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

    • Latest version
    • Version 10.x
      • Version 10.2.0
      • Version 10.0.21
      • Version 10.0.20
      • Version 10.0.10
      • Version 10.0.0
    • Version 9.x
      • Version 9.6.42
      • Version 9.6.40
      • Version 9.6.33
      • Version 9.6.32
      • Version 9.6.31
      • Version 9.6.30
      • Version 9.6.20
      • Version 9.6.10
      • Version 9.6.0
      • Version 9.4.0
      • Version 9.2.0
      • Version 9.0.0
    • Version 8.x
      • Version 8.8.0
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.0
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
    • Version 7.x
      • Version 7.6.0
      • Version 7.5.0
    Change +