Imports an image into the recognition image management subsystem.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_REC_image_import( HIGEAR hIGear, LPHIG_REC_IMAGE lphRecImage ); |
Arguments:
hIGear | Handle of a HIGEAR image to import. |
lphRecImage | Address of a variable to store the handle of the created recognition image. |
Return Value:
Returns the number of ImageGear errors that occurred during this function call.Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Remarks:
If the image pixel format is not supported by the Recognition engine natively, ImageGear converts the image into one of the supported pixel formats during the import. As a result, after exporting such image back to HIGEAR, its pixel format may differ from the original one. ImageGear uses the following conversion rules:
- 1 bit grayscale and indexed images are imported without conversion.
- 8 bit grayscale and indexed images are imported without conversion.
- 24-bit RGB images are imported without conversion.
- 2-7, 9-32 bit grayscale images are converted into 8-bit grayscale.
- 2-7 bit indexed images are converted into 8-bit indexed.
- Any other pixel formats are converted to 24-bit RGB.
When importing, primary image conversion can be applied to the image depending on the current primary reduction mode (IG_REC_primary_reduction_mode_set). IG_REC_IMG_CONVERSION_NO mode is most efficient because it doesn't involve internal creation of an image copy.
This function activates the IG_REC_PID_IMGINPUT process.
The function will add IGE_INVALID_RESOLUTION_VALUE error to the error stack if the resolution of hIGear is zero or uses undefined units (IG_RESOLUTION_NO_ABS).
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_image_delete(higImage); ErrCount += IG_REC_image_delete(higRecImage); |