How to upgrade to a newer version

Upgrade from version 7.x to 7.x

For minor upgrade between 7.x, you only need to replace the old assembly files with the new ones. Your previous SDK license is still compatible with the new version. See Distribution section for more info.

Upgrade from version 6.x to 7.x

We made some structural updates in v7.0. To upgrade from 6.x to 7.x, we recommend you to review our sample code below to upgrade your barcode reading module using the latest version of our SDK.

API changes

Runtime settings changes

Comparing to version 6.x, some runtime settings have been removed while many new runtime settings have been added to version 7.x. And in v7.x, to use the runtime settings with arguments, you can use the method SetModeArgument().

Localization algorithm

In v6.x, mLocalizationAlgorithmPriority and mAntiDamageLevel are used together to control the priority and the number of localization algorithms to be used. In v7.x, such control is conducted by localizationModes, using the index of the array to determine the priority, and the element of the array determines the localization algorithms to be used for barcode detection. In addition, v7.x added a new algorithm,'Scan Directly'(variable name: LM_SCAN_DIRECTLY), which is optimized for interactive scenarios such as scanning barcode via mobile camera.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mLocalizationAlgorithmPriority="Statistics, Lines, ConnectedBlocks, FullImageAsBarcodeZone";
 runtimeSettings.mAntiDamageLevel=7;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.localizationModes[0] = LM_STATISTICS;
 runtimeSettings.localizationModes[1] = LM_LINES;
 runtimeSettings.localizationModes[2] = LM_CONNECTED_BLOCKS ;
 runtimeSettings.localizationModes[3] = LM_SKIP;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Image binarization control

In v6.x, binarization is controlled by the runtime settings, mEnableFillBinaryVacancy and mBinarizationBlockSize. In v7.x, such process is set and controlled by binarizationModes. Such mode can be set to one or more values. In addition, the binarizationModes contains many arguments, including EnableFillBinaryVacancy, BlockSizeX, BlockSizeY.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mEnableFillBinaryVacancy= 1;
 runtimeSettings.mBinarizationBlockSize= 9;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.binarizationModes.[0] = BM_LOCAL_BLOCK;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
 reader.SetModeArgument("BinarizationModes",0, "EnableFillBinaryVacancy","1");
 reader.SetModeArgument("BinarizationModes",0, "BlockSizeX","9");

The texture filter mode

In v6.x, the texture filter mode (mTextFilterMode) can only be set to Enable or Disable. In v7.x, the text filter(textFilterModes) can be set to one or more modes using PublicRuntimeSettings.furtherModes.textFilterModes. It contains two arguments including MinImageDimension and Sensitivity.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mTextFilterMode= TFM_Enable;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.furtherModes.textFilterModes[0] = TFM_GENERAL_CONTOUR;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
 reader.SetModeArgument("TextFilterModes",0, "Sensitivity","5");

Region predetection mode

In v6.x, the region predetection (mRegionPredetectionMode) can only be set to Enable or Disable. In v7.x, the region predetection (regionPredetectionModes) can be set to one or more modes using PublicRuntimeSettings.furtherModes.regionPredetectionModes. It contains two arguments including MinImageDimension and Sensitivity.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mRegionPredetectionMode= RPM_Enable ;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.furtherModes.regionPredetectionModes[0] = RPM_GENERAL;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
 reader.SetModeArgument("regionPredetectionModes",0, "Sensitivity","5");

Gray equalization sensitivity

In v6.x, the gray equalization sensitivity (mGrayEqualizationSensitivity) is used to set the sensitivity for gray equalization. In v7.x, sensitivity is used as an argument of IPM_GRAY_EQUALIZE, that's to say, the IPM_GRAY_EQUALIZE needs to be set in imagePreprocessingModes, and then use SetModeArgument set the sensitivity.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mGrayEqualizationSensitivity = 9;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.furtherModes.imagePreprocessingModes[0] = IPM_GENERAL;
 runtimeSettings.furtherModes.imagePreprocessingModes[1] = IPM_GRAY_EQUALIZE;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
 reader.SetModeArgument("ImagePreprocessingModes ",1, "Sensitivity","9");

Texture detection sensitivity

In v6.x, the texture detection sensitivity (mTextureDetectionSensitivity) is used to set the sensitivity for texture detection, to smooth and filter out the texture of the background such as the texture of the screen when one tries to scan barcodes on screen. In v7.x, sensitivity is used as an argument of texture detection.

Sample code using 6.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.mTextureDetectionSensitivity = 9;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);

Sample code using 7.x version with C++:

 reader.GetRuntimeSettings(&runtimeSettings);
 runtimeSettings.furtherModes.textureDetectionModes[0] = TDM_GENERAL_WIDTH_CONCENTRATION;
 reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
 reader.SetModeArgument("textureDetectionModes",0, "Sensitivity","9");

Localization result

In v6.x, all the localization results can be obtained by the method GetAllLocalizationResults(), including the localized but not decoded barcodes. In v7.x, only the results of the decoded barcodes can be stored in LocalizationResult. To obtain all the localized barcodes including not decoded ones, you need to set IRT_TYPED_BARCODE_ZONE.

Sample code using 7.x version with C++:

reader.GetRuntimeSettings(&runtimeSettings);
runtimeSettings.intermediateResultTypes = IRT_TYPED_BARCODE_ZONE;
reader.UpdateRuntimeSettings(&runtimeSettings,szErrorMsg,256);
reader.DecodeFile("Your image file path", "");
IntermediateResultArray* pResults;
reader.GetIntermediateResults(&pResults);
for(int irIndex=0; irIndex<pIntermediateResults->resultsCount; irIndex++)
{
    IntermediateResult* ir = pIntermediateResults->results[irIndex];
    for(int lrIndex=0; lrIndex<ir->resultsCount; lrIndex++)
    {
        LocalizationResult* lr = (LocalizationResult*) ir->results[lrIndex];
        //your codes to using the localization result
    }
}

results matching ""

    No results matching ""