ImageGear for C and C++ on Windows v19.4 - Updated
IG_REC_timeout_set
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Recognition Settings Functions > IG_REC_timeout_set

Specifies the global timeout setting.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_timeout_set(
   AT_INT TimeOut
);

Arguments:

Name Type Description
TimeOut AT_INT Timeout value to be set, in milliseconds or AM_TIMEOUT_INFINITE. Specifying the AM_TIMEOUT_INFINITE timeout value disables the watch-dog mechanism in the recognition engine.

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;
DWORD dwTimeout = 180000;
ErrCount += IG_REC_timeout_set(dwTimeout);

Remarks:

  1. This setting is used by the recognition engine to implement a watch-dog feature for avoiding rare but annoying dead-lock situations (infinite loops).
  2. This feature is currently applied to the following internal processes of the recognition engine:
    • Image pre-processing (IG_REC_PID_IMGPREPROCESS process)
    • Page-layout decomposition, also known as page parsing or auto-zoning (IG_REC_PID_DECOMPOSITION process)
    • Recognition (IG_REC_PID_RECOGNITION1, IG_REC_PID_RECOGNITION2, and IG_REC_PID_RECOGNITION3 processes)
  3. The value specified here allows a module to process an image for no longer than the time specified. When the TimeOut value is reached, the recognition engine terminates the running of the appropriate module and resets it. The calling function returns with the non-zero value to the integrating application and set Value1 of the error to IGE_REC_EXT_API_TIMEOUT_ERR, signaling that the processing of the image could not be successfully completed.
  4. Though disabling the timeout feature (by calling this function with the AM_TIMEOUT_INFINITE parameter) may speed up the component's initialization, enabling the watch-dog mechanism is recommended.
  5. If this function is not called to specify the module timeout setting, the default value of this setting, 180000 milliseconds (3 minutes) is applied, i.e., no internal process will be allowed to continue for more than three minutes.