L_OcrEngineManager_CreateEngine

Summary

Creates an instance of L_OcrEngine to use later on starting up the engine and some other functionality.

Syntax

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrEngineManager_CreateEngine(engineType, engine)

Parameters

L_OcrEngineType engineType

OCR engine type you wish to work with, currently L_OcrEngineType_LEAD is the only available engine.

L_OcrEngine* engine

Pointer to a L_OcrEngine handle to be updated with the initialized OCR engine handle. Use this handle for other OCR functionality.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

L_OcrEngineManager_CreateEngine must be called before calling any other LEADTOOLS LTOCR toolkit functions.

The user must unlock LEADTOOLS OCR Module - LEAD Engine using the L_SetLicenseFile function. If the LEADTOOLS OCR Module - LEAD Engine is locked then the L_OcrEngineManager_CreateEngine function will fail and will not initialize the OCR engine.

When the handle to the OCR engine is no longer needed, it should be freed by calling L_OcrEngine_Destroy. For every call to L_OcrEngineManager_CreateEngine there must be an associated call to L_OcrEngine_Destroy.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT L_OcrEngineManager_CreateEngineExample() 
{ 
   // Create an instance of the engine 
   L_OcrEngine ocrEngine = NULL; 
   L_INT retCode = L_OcrEngineManager_CreateEngine(L_OcrEngineType_LEAD, &ocrEngine); 
   if(retCode != SUCCESS) 
      return retCode; 
 
   // Start the engine using default parameters 
   retCode = L_OcrEngine_Startup(ocrEngine, NULL, OCR_LEAD_RUNTIME_DIR); 
 
   if(L_OcrEngine_IsStarted(ocrEngine)) 
      std::cout << "Engine started successfully.\n"; 
   else 
      std::cout << "Engine failed to start.\n"; 
 
   // Shutdown the engine 
   if(ocrEngine != NULL) 
   { 
      L_OcrEngine_Destroy(ocrEngine); 
      std::cout << "Engine shut down & destroyed.\n"; 
   } 
 
   return retCode; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS OCR Module - LEAD Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.