How to Upgrade
From version 9.x or earlier to version 10.x
Dynamsoft Barcode Reader SDK has been refactored to integrate with DynamsoftCaptureVision (DCV)
architecture. To upgrade from version 9.x or earlier to 10.x, we recommend you to follow the User Guide and re-write your codes.
Update the License Key
Request a 30-Day Free Trial License
Visit the Request a Trial License page to obtain a 30-day free license. This option is ideal for initial evaluation or testing of new SDK features.
Annual Online Full License
If you are using an Annual Online Full License, your license will continue to work with the current SDK version without the need for updates. Go to Customer Portal to get your license key.
Perpetual License
For users with a Perpetual License, please contact our sales team to update your license. You can reach out through our Contacting Us page for assistance.
Update the Included Headers, libs & DLLs
Since the SDK architecture is changed, you have to change your code for including the headers, libs and DLLs. You can use the following code to replace your previous code.
#include "[INSTALLATION FOLDER]/Include/DynamsoftCaptureVisionRouter.h"
using namespace std;
using namespace dynamsoft::license;
using namespace dynamsoft::cvr;
using namespace dynamsoft::dbr;
using namespace dynamsoft::utility;
#if defined(_WIN64) || defined(_WIN32)
#ifdef _WIN64
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x64/DynamsoftCorex64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x64/DynamsoftLicensex64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x64/DynamsoftCaptureVisionRouterx64.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x64/DynamsoftUtilityx64.lib")
#else
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x86/DynamsoftCorex86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x86/DynamsoftLicensex86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x86/DynamsoftCaptureVisionRouterx86.lib")
#pragma comment(lib, "[INSTALLATION FOLDER]/Distributables/Lib/Windows/x86/DynamsoftUtilityx86.lib")
#endif
#endif
Distribution
- Copy
[INSTALLATION FOLDER]/Distributables/DBR-PresetTemplates.json
to the same folder as the executable program. - Copy the libraries to the same folder as the executable program.
-
For Windows: Copy ALL
*.dll
files under[INSTALLATION FOLDER]/Distributables/Lib/Windows/[platform]
. Replace[platform]
with your project’s platform setting. -
For Linux: Copy ALL
*.so
files under[INSTALLATION FOLDER]/Distributables/Lib/Linux/[platform]
. Replace[platform]
with your project’s platform setting.
-
Update the License Activation Code
Starting from 10.0, we have unified the API for setting licenses across different Dynamsoft products.
Old APIs | New APIs |
---|---|
CBarcodeReader.InitLicense |
CLicenseManager.InitLicense |
Update Single Image Decoding APIs
The APIs for decoding single image has been adjusted as follows:
Old APIs | New APIs |
---|---|
CBarcodeReader.DecodeFile |
CCaptureVisionRouter.Capture(const char* filePath, const char* templateName) |
CBarcodeReader.DecodeFileInMemory |
CCaptureVisionRouter.Capture(const unsigned char *fileBytes, int fileSize, const char* templateName) |
CBarcodeReader.DecodeBuffer |
CCaptureVisionRouter.Capture(const CImageData* pImageData, const char* templateName) |
struct TextResult |
class CBarcodeResultItem |
struct TextResultArray |
class CCapturedResult |
CBarcodeReader.DecodeBase64String |
Currently not available. |
CBarcodeReader.DecodeDIB |
Currently not available. |
Update Video Streaming Decoding Code
CImageSourceAdapter
is added to replace the FrameDecodeingParameters
and the previous video methods. You should implement CImageSourceAdapter
to transfer image data from camera or video file to buffer. The following code snippet demonstrate basic usage of decoding video frames:
class MyVideoSource : public CProactiveImageSourceAdapter
{
// You should implement the `HasNextImageToFetch` method to indicate if there is a next frame
bool HasNextImageToFetch() const override
{
return true;
}
// You should implement the `FetchImage` method to get the next frame
CImageData* FetchImage() override
{
// Add code to get the video frame from camera or video file
}
};
class MyBarcodeResultReceiver: public CCapturedResultReceiver
{
public:
virtual void OnDecodedBarcodesReceived(DecodedBarcodesResult * result) {
// Add code to process the result
}
};
int main()
{
CCaptureVisionRouter *cvr = new CCaptureVisionRouter;
// Create your video source and bind it to the router
MyVideoSource *source = new MyVideoSource;
cvr->SetInput(source);
// Create a CCapturedResultReceiver instance
MyBarcodeResultReceiver *barcodesReceiver = new MyCapturedResultReceiver;
cvr->AddResultReceiver(barcodesReceiver);
// Start capturing
errorCode = cvr->StartCapturing(CPresetTemplate::PT_READ_BARCODES, true, errorMsg, 512);
delete barcodesReceiver;
delete source;
delete cvr;
}
Migrate Your Templates
The template system is upgraded. The template you used for the previous version can’t be directly recognized by the new version. Please download the TemplateConverter tool or contact us to upgrade your template.
The template-based APIs have been updated as follows:
Old APIs | New APIs |
---|---|
CBarcodeReader.InitRuntimeSettingsWithFile |
CCaptureVisionRouter.InitSettingsFromFile |
CBarcodeReader.InitRuntimeSettingsWithString |
CCaptureVisionRouter.InitSettings |
CBarcodeReader.OutputSettingsToFile |
CCaptureVisionRouter.OutputSettingsToFile |
CBarcodeReader.OutputSettingsToString |
CCaptureVisionRouter.OutputSettings |
CBarcodeReader.ResetRuntimeSettings |
CCaptureVisionRouter.ResetSettings |
CBarcodeReader.AppendTplFileToRuntimeSettings |
Not available. |
CBarcodeReader.AppendTplStringToRuntimeSettings |
Not available. |
Migrate Your PublicRuntimeSettings
The struct PublicRuntimeSettings
has been refactored. It retains commonly used properties while removing the previously complex property settings, which are now exclusively supported through templates.
The APIs for accessing and updating PublicRuntimeSettings
has been adjusted as follows:
Old APIs | New APIs |
---|---|
CBarcodeReader.GetRuntimeSettings |
CCaptureVisionRouter.GetSimplifiedSettings |
CBarcodeReader.UpdateRuntimeSettings |
CCaptureVisionRouter.UpdateSettings |
Migrate to SimplifiedCaptureVisionSettings
The following properties are replaced by similar properties under SimplifiedCaptureVisionSettings
. They can also be set via a template file(String).
PublicRuntimeSettings Property | SimplifiedCaptureVisionSettings Parameter | Template File Parameter |
---|---|---|
region |
roi & roiMeasuredInPercentage |
TargetROIDef.Location.Offset |
timeout |
timeout |
CaptureVisionTemplates.Timeout |
Migrate to SimplifiedBarcodeReaderSettings
The following properties are replaced by similar properties under SimplifiedBarcodeReaderSettings
. The majority of them can also be set via a template file(String).
PublicRuntimeSettings Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
---|---|---|
minBarcodeTextLength |
minBarcodeTextLength |
BarcodeFormatSpecification.BarcodeTextLengthRangeArray |
minResultConfidence |
minResultConfidence |
BarcodeFormatSpecification.MinResultConfidence |
localizationModes |
localizationModes |
BarcodeReaderTaskSetting.LocationModes |
expectedBarcodesCount |
expectedBarcodesCount |
BarcodeReaderTaskSetting.ExpectedBarcodesCount |
barcodeFormatIds |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
barcodeFormatIds_2 |
barcodeFormatIds |
BarcodeReaderTaskSetting.BarcodeFormatIds |
deblurModes |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
deblurLevel |
deblurModes |
BarcodeReaderTaskSetting.DeblurModes |
maxAlgorithmThreadCount |
maxThreadsInOneTask |
BarcodeReaderTaskSetting.MaxThreadsInOneTask |
Remarks:
- The 2 groups of barcode formats are merged.
DeblurLevel
is deprecated. You can useDeblurModes
instead.
FurtherModes Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
---|---|---|
grayscaleTransformationModes |
grayscaleTransformationModes |
ImageParameter.GrayscaleTransformationModes |
imagePreprocessingModes |
grayscaleEnhancementModes |
ImageParameter.GrayscaleEnhancementModes |
Remarks: The mode
IPM_MORPHOLOGY
ofimagePreprocessingModes
is migrated toBinarizationModes
. The mode argumentsMorphOperation
,MorphOperationKernelSizeX
,MorphOperationKernelSizeY
,MorphShape
are now available for all modes ofBinarizationModes
.
Migrate to Template File
The following properties can only be set via a template file. Please contact us so that we can help you to transform your current settings to a new template file.
PublicRuntimeSettings Property | Template File Parameter |
---|---|
scaleDownThreshold |
ImageParameter.ScaleDownThreshold |
binarizationModes |
ImageParameter.BinarizationModes |
textResultOrderModes |
BarcodeReaderTaskSetting.TextResultOrderModes |
returnBarcodeZoneClarity |
BarcodeReaderTaskSetting.ReturnBarcodeZoneClarity |
scaleUpModes |
ImageParameter.ScaleUpModes |
barcodeZoneMinDistanceToImageBorders |
BarcodeFormatSpecification.BarcodeZoneMinDistanceToImageBorders |
terminatePhase |
BarcodeReaderTaskSetting.TerminateSettings |
FurtherModes Property | Template File Parameter |
---|---|
colourConversionModes |
ImageParameter.ColourConversionModes |
regionPredetectionModes |
ImageParameter.RegionPredetectionModes |
textureDetectionModes |
ImageParameter.TextureDetectionModes |
textFilterModes |
ImageParameter.TextDetectionMode & ImageParameter.IfEraseTextZone |
dpmCodeReadingModes |
BarcodeReaderTaskSetting.DPMCodeReadingModes |
deformationResistingModes |
BarcodeReaderTaskSetting.DeformationResistingModes |
barcodeComplementModes |
BarcodeReaderTaskSetting.BarcodeComplementModes |
barcodeColourModes |
BarcodeReaderTaskSetting.BarcodeColourModes |
Migrate to Other APIs
The PDF properties of PublicRuntimeSettings are moved to set via the setPDFReadingParameter
method of CDirectoryFetcher
and CFileFetcher
with a CPDFReadingParameter
parameter.
PublicRuntimeSettings Property |
---|
pdfReadingMode |
pdfRasterDPI |
The Intermediate Result
system is redesigned and the following properties are deprecated.
PublicRuntimeSettings Property |
---|
intermediateResultTypes |
intermediateResultSavingMode |
Removed
The following properties are removed.
PublicRuntimeSettings Property |
---|
resultCoordinateType |
FurtherModes Property |
---|
colourClusteringModes |