ImageGear Professional v18.2 > API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Zone Support Functions > IG_REC_zones_locate |
Analyzes the structure of the page layout of the image (auto-zoning).
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_REC_zones_locate( HIG_REC_IMAGE hImage, LPAT_RECT lpRect ); |
Name | Type | Description |
hImage | HIG_REC_IMAGE | Handle of the image. |
lpRect | AT_RECT | Active image area for the analysis. The function will be effective only within this rectangle. If this parameter is NULL, then the entire hImage image will be processed. |
See IG_REC_image_import.
Copy Code
|
|
---|---|
AT_ERRCOUNT ErrCount = 0; HIG_REC_IMAGE higRecImage = 0; HIGEAR higImage = 0; ErrCount += IG_load_file("Image.tif", &higImage); ErrCount += IG_REC_image_import(higImage, &higRecImage); ErrCount += IG_REC_zones_locate(higRecImage, NULL); //... ErrCount += IG_REC_image_delete(higRecImage); ErrCount += IG_image_delete(higImage); |
The function performs the analysis within the specified area of the image: it finds text or graphics blocks within the specified area, builds a zone list and then connects it to the hImage image.
This function activates the IG_REC_PID_DECOMPOSITION process.
1. If the hImage image is not bi-tonal one (i.e., it is a grayscale or a color image), an implicit secondary image conversion step is performed automatically to convert the image to a new, internal and despeckled bi-tonal image on which the auto-zoning function will operate. The parameter for this conversion can be specified through the function IG_REC_secondary_reduction_mode_set.
With bi-tonal images at over a resolution of 280 dpi, if the Image despeckle mode setting is enabled, an implicit secondary image conversion step is also performed. This is enabled through the function IG_REC_despeckle_mode_set.
2. Zones found by this function are entered in a sequential list, called the zone list, which is attached to the hImage image. When this function is called, any previously inserted zones are deleted from this list.
3. The IG_REC_zones_count_get function can be used to retrieve the number of zones in the zone list for an image. Zones can be deleted from this list by the IG_REC_zone_delete function. The application can get the zone parameters by the IG_REC_zone_info_get function. After modifying some zone attributes, the IG_REC_zone_info_set function can be used to make the changes effective.
4. This function finds the zone coordinates and the type of the zones. The zone type determines the role of the zone in the image layout.
5. This version of the Recognition component offers three page parser algorithms to be chosen. Unless specified otherwise, the more accurate one will be applied. Use the IG_REC_decomp_method_set function to change the Page parser algorithm settings.
6. Setting the Force Single Column mode (IG_REC_decomp_single_column_force_set) can influence the working of this function. It prevents detecting columns, which means decolumnization is not available. It can be useful for conserving the columnar structure in tables.
7. New zones created by this function always take the value IG_REC_FILTER_DEFAULT, meaning that the zone will take on the global filter setting (which is by default IG_REC_FILTER_ALL to have no filtering).
8. New zones located by this function always have the IG_REC_FM_DEFAULT and IG_REC_RM_AUTO values in their FillingMethod and RecognitionModule fields, respectively. The "meaning" of the IG_REC_FM_DEFAULT filling method can be specified with the IG_REC_default_filling_method_set function.
On the other hand, there is no similar function for specifying the default recognition module, since the recognition module to be applied will be automatically chosen according to the zone's filling method enumIGRecFillingMethod, and Character Set settings. In order to overrule this automatic enumIGRecRecognitionModule selection, you must update each zone in the zone list with the IG_REC_zone_info_set function.
9. New zones created by this function always have empty strings in their UserDictionarySection field, which specifies the use of the default section of any enabled User dictionary.
10. Another useful function, IG_REC_image_filling_method_detect, can help when you don't know the type of page to be processed.