RemoveColorObjectsEx Method of the ImageDocument Object
This method removes from the image all color objects of the specified hues and replaces them with the specified color. It also allows you to save a separate image containing only the extracted objects.
Important! This method can be used for color images only.
Syntax
C++
HRESULT RemoveColorObjectsEx(
IIntsCollection* ColorHues,
int BackgroundColor,
IImage** ColorLayer
);
C#
Image RemoveColorObjectsEx(
IIntsCollection ColorHues,
int BackgroundColor
);
Visual Basic .NET
Function RemoveColorObjectsEx( _ ColorHues As IIntsCollection, _ BackgroundColor As Integer _ ) As Image
Parameters
- ColorHues
- [in] Refers to the IntsCollection object which contains a collection of the hues of the objects which must be filtered, in HSL representation. You may pass null for this parameter, in which case all colored objects are removed, and only the gray image remains.
- The number which specifies a hue must be in range from 0 to 255. The value 0 corresponds to red color, 43 — to yellow, 85 — to green, 171 — to blue, 213 — to purple.
- BackgroundColor
- [in] Specifies the color which must replace the removed color objects. If you pass -1 for this parameter, the background color is determined automatically.
- ColorLayer
- [out, retval] A pointer to the IImage* pointer variable that receives the interface pointer of the output Image object which contains the extracted color objects.
Return values
This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.
Remarks
This method applies color filtering to the color image plane of the ImageDocument. All the other pages are deleted from the ImageDocument. They will be created upon demand.
There is also a special preprocessing mode which performs the same kind of color objects filtering before recognizing the image and can restore them automatically before export: IPageProcessingParams::ProhibitColorObjectsAtProcessing. Choose the most acceptable setting for your scenario.
See also
17.09.2024 15:14:40