Documentation
Table of contents

Thanks for downloading Dynamsoft Label Recognizer Package!

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

How to Upgrade

From 2.x to 3.x

Dynamsoft Label Recognizer SDK has been refactored to integrate with DynamsoftCaptureVision (DCV) architecture. Notice the following break changes when upgrading your SDK.

Update the Included .h .lib & .dll/.so file

Since the SDK architecture is changed, you have to change you code for including the headers, libs(windows only). You can use the following code to replace your previous code.

#include "[INSTALLATION FOLDER]/Dynamsoft/Include/DynamsoftCaptureVisionRouter.h"

using namespace std;
using namespace dynamsoft::license;
using namespace dynamsoft::cvr;
using namespace dynamsoft::dlr;

#if defined(_WIN64) || defined(_WIN32)
    #ifdef _WIN64
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x64/DynamsoftLicensex64.lib")
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x64/DynamsoftCaptureVisionRouterx64.lib")
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x64/DynamsoftCorex64.lib")
    #else
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x86/DynamsoftLicensex86.lib")
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x86/DynamsoftCaptureVisionRouterx86.lib")
        #pragma comment(lib, "[INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Windows/x86/DynamsoftCorex86.lib")
    #endif
#endif

Distribution

  • Copy [INSTALLATION FOLDER]/Dynamsoft/Distributables/DLR-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]/Dynamsoft/Distributables/Lib/Windows/[platform]. Replace [platform] with your project’s platform setting.
    • For Linux: Copy ALL *.so files under [INSTALLATION FOLDER]/Dynamsoft/Distributables/Lib/Linux/[platform]. Replace [platform] with your project’s platform setting.

Update Single Image Recognizing APIs

The APIs for recognizing single image has been adjusted as follows:

Old APIs New APIs
CLabelRecognizer.RecognizeFile CCaptureVisionRouter.Capture(const char* filePath, const char* templateName)
CLabelRecognizer.RecognizeFileInMemory CCaptureVisionRouter.Capture(const unsigned char *fileBytes, int fileSize, const char* templateName)
CLabelRecognizer.RecognizeBuffer CCaptureVisionRouter.Capture(const CImageData* pImageData, const char* templateName)
struct DLR_Result class CTextLineResultItem
struct DLR_ResultArray class CCapturedResult

Note: The Capture API is designed to recognize text in single-page files, such as images or PDFs. If you need to extract text from multi-page files, it is recommended to use the CFileFetcher instead.

Update Video Streaming Recognizing 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 recognizing 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 MyTextLineResultReceiver: public CCapturedResultReceiver
{
public:
    virtual void OnRecognizedTextLinesReceived(RecognizedTextLinesResult * 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 
    MyTextLineResultReceiver *labelReceiver = new MyTextLineResultReceiver;
    cvr->AddResultReceiver(labelReceiver);

    // Start capturing
    errorCode = cvr->StartCapturing(CPresetTemplate::PT_RECOGNIZE_TEXT_LINES, true, errorMsg, 512);

    delete labelReceiver;
    delete source;
    delete cvr;
}

Update Images Batch Recognizing Code

  1. DCV architecture allows you to set a folder as an image source to fetch image from. To use this feature, you have to set CDirectoryFetcher as the input via class CCaptureVisionRouter.
  2. You need to register a CCapturedResultReceiver to receive the label recognizing results.
  3. Please refer to the user guide for more details.

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 contact us to upgrade your template.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

    • Latest version(3.2.20)
    • Version 3.x
      • Version 3.2.10
      • Version 3.2.0
      • Version 3.0.30
      • Version 3.0.20
      • Version 3.0.10
      • Version 3.0.0
    • Version 2.x
      • Version 2.2.20
      • Version 2.2.11
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.0
      • Version 2.2.20
      • Version 2.2.11
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.0
      • Version 2.0.0
      • Version 2.0.0
    • Version 1.x
      • Version 1.2.1
      • Version 1.2
      • Version 1.0
      • Version 1.2.1
      • Version 1.2
      • Version 1.0
      • Version 1.2.1
      • Version 1.2
      • Version 1.0
      • Version 1.2.1
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support