ImageGear for C and C++ on Windows v19.1 - Updated
IG_REC_image_filling_method_detect
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Recognition Image Preprocessing Functions > IG_REC_image_filling_method_detect

Tries to determine the type of the text in the zones of a page globally (e.g., machine printed or dot-matrix printed text).

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_image_filling_method_detect(
   HIG_REC_IMAGE hImage,
   enumIGRecFillingMethod* pfm
);

Arguments:

Name Type Description
hImage HIG_REC_IMAGE Handle of the image to be processed.
pfm enumIGRecFillingMethod* Pointer to a variable to get the detected type of filling method or NULL.

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;
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_filling_method_detect(higRecImage, NULL);
ErrCount += IG_REC_image_recognize(higRecImage);

//...

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

Remarks:

The function only looks into zones with the IG_REC_FM_DEFAULT value in their FillingMethod field. The detected filling method type is provided in the pfm variable.

Another use of this function is when it is called with NULL in its pfm parameter. In this case the function performs a zone by zone analysis (instead of suggesting a general filling type for the entire image), and if the algorithm can determine a type for a given zone, the function replaces the IG_REC_FM_DEFAULT value in the zone's FillingMethod field by the determined one.

  1. This function is useful when there is an image with an unknown or uncertain type of text. (This quite often occurs when working with filled forms.) The types that can be detected with this function are IG_REC_FM_OMNIFONT, IG_REC_FM_DRAFTDOT9, IG_REC_FM_DRAFTDOT24, and IG_REC_FM_NO_OCR.
  2. If there are no zones with IG_REC_FM_DEFAULT type at all in the image, this function will not operate and provides the value IG_REC_FM_DEFAULT in the pfm variable. When at least one zone with IG_REC_FM_DEFAULT exists, the application may want to call the IG_REC_default_filling_method_set function with the detected enumIGRecFillingMethod as its parameter.
  3. If the pfm parameter had an input NULL value, the function tries to detect the filling type, zone by zone. If the detection is successful, the function DOES IMMEDIATELY CHANGE two fields of the given zone:

    If the detection was unsuccessful, both fields of the zone remain intact.

  4. The application should check whether the current recognition engine configuration contains the proper enumIGRecRecognitionModule for recognizing the detected filling method.

See Also

HIG_REC_IMAGE