ImageGear for C and C++ on Windows v19.3 - Updated
IG_REC_secondary_reduction_mode_set
API Reference Guide > Recognition Component API Reference > Recognition Component Functions Reference > Image Processing Functions > IG_REC_secondary_reduction_mode_set

Specifies which Secondary image conversion mode will be used during an implicit Secondary image conversion step.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_REC_secondary_reduction_mode_set(
   enumIGRecImgConversion BWConversion
);

Arguments:

Name Type Description
BWConversion enumIGRecImgConversion Secondary image conversion mode to be set.

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_secondary_reduction_mode_set(IG_REC_IMG_CONVERSION_AUTO);

Remarks:

This algorithm is performed automatically when the application calls an API function (for example auto-zoning, recognition, deskew detection) whose operation requires a bi-tonal image, but the requested image is not a bi-tonal one. This setting influences how a non-bi-tonal hImage image, stored in the recognition engine, will be converted to a bi-tonal one.

This setting might influence the accuracy of the recognition.

  1. Both IG_REC_primary_reduction_mode_set and IG_REC_secondary_reduction_mode_set functions specify Image conversion modes.
  2. The IG_REC_primary_reduction_mode_set function specifies the mode to be applied during the IG_REC_PID_IMGINPUT process (primary image conversion). The result of this process is an hImage image under the memory space of the recognition engine. Depending on the original image source AND the Primary image conversion mode setting (specified with IG_REC_primary_reduction_mode_set), the created image will be bi-tonal, grayscale, or color.
  3. On the other hand, a Secondary image conversion with BWConversion mode might be performed on existing hImage images. In this case a second, bi-tonal image will be created. This step is called either directly (from within the IG_REC_image_reduce_to_bitonal function) or implicitly, as described above. For example, when the IG_REC_image_recognize function has been called for a non-bi-tonal image, an implicit secondary image conversion will be performed automatically. The IG_REC_image_recognize function implicitly may include the conversion of the image, if necessary. A previous IG_REC_secondary_reduction_mode_set call allows you to specify how this implicit conversion will be performed.
  4. When the Secondary image conversion is called implicitly, the resulting bi-tonal image won't be accessible to the integrating application, so the application doesn't have to take care of freeing it. If the current resolution enhancement mode is IG_REC_IMG_RE_YES, or it is IG_REC_IMG_RE_AUTO with the image resolution less than 150 dpi, resolution enhancement is applied to the image. This means that the resolution of the created bi-tonal image will be double of the resolution of the original one. If the image is a bi-tonal one, the implicit secondary image conversion may create a despeckled image using an adaptive noise removal algorithm. Though this image is not accessible to the application, in fact internally this despeckled image is passed for the recognition or auto-zoning functions.
  5. If this function is not called, the default value of IG_REC_IMG_CONVERSION_AUTO is applied.