You are here: Start » Filter Reference » Computer Vision » Image Segmentation » SegmentImage_Color
Module: | FoundationPro |
---|
Segments an image basing on distance to model colors.
Applications
Name | Type | Range | Description | |
---|---|---|---|---|
inImage | Image | Input image | ||
inRoi | Region* | Range of pixels to be processed | ||
inReferenceColors | PixelArray | Colors to compare pixels to | ||
inMaxDifference | Real | 0.0 - | Maximal difference between pixel and reference color to be accepted | |
inDifferenceMultipliers | RealArray* | Scales for maximum differences for each color | ||
inChromaAmount | Real | 0.0 - 1.0 | Proportion of chromatic information in distance computation | |
inForceDisjointRegions | Bool | Force output regions to be disjoint | ||
outRegions | RegionArray | Regions of pixels closest to colors |
Description
The operation finds regions of similar colors in RGB color space within inImage.
First, for each pixel of the input image its distance to each color in inReferenceColors is computed (see ColorDistanceImage function).
Then, for each reference color c, the function computes region of pixels that are closer to c than its corresponding threshold. In case inDifferenceMultipliers is Nil, threshold is equal to inMaxDifference. If inDifferenceMultipliers is not Nil, corresponding threshold is the product of inMaxDifference and the element of inDifferenceMultipliers that corresponds to c.
If flag inForceDisjointRegions is set to True, the regions are forced to be disjoint. In case a pixel has distance less than threshold for more than one color, distances are divided by thresholds and the minimum of ratios is taken. In particular, if the function works in one-threshold mode, the operation described above becomes simply minimum of distances.
Examples
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Inconsistent array sizes in SegmentImage_Color. |
DomainError | Reference color array size too big in SegmentImage_Color. |
Complexity Level
This filter is available on Advanced Complexity Level.
Filter Group
This filter is member of SegmentImage filter group.
See Also
- ColorDistance – Compares two pixels using chromatic and non-chromatic information. Assumes RGB color space.
- ColorDistanceImage – Compares each pixel with the specified color using chromatic and non-chromatic information.