ImageGear for C and C++ on Windows v19.10 - Updated
IG_REC_image_recognize
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Recognition Functions > IG_REC_image_recognize

Performs the recognition task for a specified page.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_image_recognize(
   HIG_REC_IMAGE hImage
);

Arguments:

Name Type Description
hImage HIG_REC_IMAGE Handle of the image to be recognized.

Return Value:

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

Supported Raster Image Formats:

See IG_REC_image_import.

Example:

 
Copy Code
AT_ERRCOUNT ErrCount = 0;
HIGEAR higImage = 0;
HIG_REC_IMAGE higRecImage = 0;

ErrCount += IG_load_file("Image.tif", &higImage); 
ErrCount += IG_REC_image_import(higImage, &higRecImage);
ErrCount += IG_REC_image_recognize(higRecImage);

//...

ErrCount += IG_REC_image_delete(higRecImage);
ErrCount += IG_image_delete(higImage);

Remarks:

The function utilizes the zone information to activate the appropriate recognition module on every zone. Each recognition module recognizes the image parts assigned to it in the zone list. If the zone list of the page is empty, the decomposition will be performed automatically in order to create a zone list for the image, before recognition. After having recognized all the zones on the page, the function stores the necessary information about the recognized characters in the HIG_REC_IMAGE. The application can retrieve a copy of the recognition data by calling the IG_REC_letters_get function. The application can remove the recognition result calling IG_REC_image_recognition_data_delete.

If the current image is not a B/W one in this page (i.e., it is a gray-scale or a 24-bit color image), then an implicit secondary image conversion step will be performed automatically to convert the image to a B/W one. The parameter for this conversion can be specified through the IG_REC_secondary_reduction_mode_set.

The application can register a callback function for progress indication (IG_REC_progress_CB_register). The Engine will then call the registered (LPFNIG_REC_PROGRESS_MONITOR) callback entry point to allow progress monitoring for the application.

The recognition process uses the zones generated by the decomposition process. In addition, it may modify them.

If a recognition module is not able to recognize an object (i.e., character), this object will be marked as a rejected one. It will become marked by a rejection symbol during conversion to the final output document. IG_REC_output_rejection_symbol_set can be used to specify the rejection symbol for this.

Since the recognition algorithm may use the services of the checking module, the application should call the IG_REC_spelling_is_enabled_set, IG_REC_spelling_language_set, IG_REC_UD_set and other checking related functions BEFORE calling IG_REC_image_recognize.

Checking of recognized zone contents may consist of any combination of three facilities: a supplied Language dictionary, a User dictionary containing literals and/or regular expressions, and a user-written checking callback function.

See Also

HIG_REC_IMAGE