Starting and Shutting Down the OCR Engine

To begin using the LEADTOOLS OCR Module - LEAD Engine for C API, first create an L_OcrEngine type of OCR engine handle. Do so by calling the L_OcrEngineManager_CreateEngine method. After the engine handle is obtained, it must be initialized by calling the L_OcrEngine_Startup method. This method must be called before calling any other LEADTOOLS OCR methods.

After calling the L_OcrEngine_Startup method, load engine settings saved in a file into the engine. To load saved settings from a file, call L_OcrSettingManager_LoadFile. The setting manager handle can be obtained through by calling the L_OcrEngine_GetSettingManager method. To save engine settings into a file for later use, call L_OcrSettingManager_SaveFile.

When the OCR engine handle is no longer needed, the handle must be closed by calling the L_OcrEngine_Shutdown method. This will free all internal resources allocated by this engine instance. At this point the L_OcrEngine handle is still valid and in order to release/free that handle call L_OcrEngine_Destroy. Before recognizing any more pages, the user must call L_OcrEngine_Startup again. but if L_OcrEngine_Destroy was called the user must create a new L_OcrEngine handle by calling L_OcrEngineManager_CreateEngine and then calls L_OcrEngine_Startup passing that new handle.

It is best to call the L_OcrEngine_Destroy method after the engine handle is no longer in use. L_OcrEngine_Destroy will automatically call L_OcrEngine_Shutdown if it has not already been called, so you can optionally skip the call to L_OcrEngine_Shutdown method and call the L_OcrEngine_Destroy method instead, which will take care of shutting down the OCR engine in addition to freeing/releasing the OCR engine handle itself.

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.