ImageGear Professional DLL v18.1 for Windows
IG_REC_initialize
Send Feedback
ImageGear Professional v18.1 > API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Initialization and Cleanup Functions > IG_REC_initialize

Glossary Item Box

Initializes the Recognition component.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_initialize(
   AT_VOID 
);

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

  Copy Code
AT_ERRCOUNT ErrCount = 0;
ErrCount += IG_REC_initialize();

//...

ErrCount += IG_REC_close();

Recognition component requires additional resource files to be available. By default the component looks for these files in Resource\Recognition directory relatively to the location of igcore18d.dll (this path can be obtained via the "COMM.PATH" global control parameter). If the resource files do not exist in the default directory, the component looks for them in the directory where igcore18d.dll is located. If the files are not found in the latter directory, the function sets an error and returns a non-zero value.

The user may want to keep resource files in another location. Use "REC.RESOURCE_PATH" global control parameter to set full path to the user-defined resource directory. The parameter must be set before the call to IG_REC_initialize().

Example:

  Copy Code
AT_ERRCOUNT ErrCount = 0;
static char* path = "C:\\Program Files\\Accusoft\\ImageGear v18 DLL\\Professional\\DLL\\Bin";

IG_gctrl_item_set("REC.RESOURCE_PATH", AM_TID_MAKELP(AM_TID_CHAR), path, strlen(path) + 1, NULL);
ErrCount += IG_REC_initialize();

//...

ErrCount += IG_REC_close();

If user-defined resource path is specified, but there is no resource files in that directory, IG_REC_initialize() sets an error and returns a non-zero value. Setting "REC.RESOURCE_PATH" control parameter to NULL will tell the component to look for the resource files in the default location, as described above.

REC.RESOURCE_PATH parameter does not support relative paths.

Remarks:

Call this function after attaching the Recognition component to ImageGear, and before calling any other function of the Recognition component.

All objects that require Recognition API calls for their deletion, such as HIG_REC_IMAGE, HIG_REC_DOCUMENT, settings collections, AT_REC_LETTER arrays, wide string arrays, etc. must be deleted before the call to IG_REC_close. After IG_REC_close has been called, no Recognition API calls are allowed, except IG_REC_initialize, which initializes the component again.

©2014. Accusoft Corporation. All Rights Reserved.