How to Upgrade from Old Versions to the New Version?

From Version 7.0 to 7.x

To upgrade from version 7.0 to 7.x, you only need to replace the old assembly files with the new ones. Your previous v7.0 license is still compatible with this version.

From Version 6.x to 7.x

As version 7.x has been released and the structures of the two major versions, 6.x and 7.x have been changed, it is recommended to review our sample codes below for reference and re-create your barcode reading module using the latest version of Dynamsoft Barcode Reader.

The Changes in the APIs

The Change for the C/C++ Edtion

Please refer to The Change for the C/C++ Edition

The Change for the .NET Edition

Please refer to The Change for the .NET Edition

The Change for the Java Edition

Please refer to The Change for the Java Edition

The Change for the iOS Edition

Please refer to The Change for the iOS Edition

The Changes in the Runtime Settings Structure

Comparing to version 6.x, some of the runtime settings have been removed while many new runtime settings have been added to version 7.x. To use the runtime settings with arguments, the method SetModeArgument() needs to be used, which is one of the changes that have been made to version 7.x.

Localization Algorithm

In the 6.x version, mLocalizationAlgorithmPriority and mAntiDamageLevel are used together to control the priority and the number of localization algorithms to be used. In the version 7.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, 7.x added a new algorith,'Scan Directly'(variable name: LM_SCAN_DIRECTLY), which is used for interactive scenario 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 the version 6.x, binarization is controlled by the runtime settings, mEnableFillBinaryVacancy and mBinarizationBlockSize. In the version 7.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 the version 6.x, the texture filter mode (mTextFilterMode) can only be set to Enable or Disable. In the version 7.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 the version 6.x, the regionpredetection (mRegionPredetectionMode) can only be set to Enable or Disable. In the version 7.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 the version 6.x, the gray equalization sensitivity (mGrayEqualizationSensitivity ) is used to set the sensitivity for gray equalization. In the version 7.x, sensitivity is used as an argument of IPM_GRAY_EQUALIZE, that's to say, the IPM_GRAY_EQUALIZE needs to be set in the 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 the version 6.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 the barcode on the screen. In the version 7.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 the version 6.x, all the localization results can be obtained by the method GetAllLocalizationResults(), including the localized but not decoded barcodes. In the version 7.x, only the results of the decoded barcodes can be stored in the LocalizationResult, to obtain all the localized barcodes including not decoded ones, IRT_TYPED_BARCODE_ZONE needs to be set.

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 ""