Back to Adaptive Vision Library website
You are here: Start » Function Reference » Image Thresholding » ThresholdToRegion_Color
ThresholdToRegion_Color
Creates a region containing image pixels with values close to the given color.
Syntax
C++
C#
void avl::ThresholdToRegion_Color ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, const avl::Pixel& inRgbColor, float inChromaAmount, float inMaxDifference, float inHysteresis, avl::Region& outRegion )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | const Image& | Input image | |||
inRoi | Optional<const Region&> | NIL | Region of interest | ||
inRgbColor | const Pixel& | Color to compare the image to | |||
inChromaAmount | float | 0.0 - 1.0 | 0.7f | Proportion of chromatic information in distance computation | |
inMaxDifference | float | 0.0 - | 5.0f | Maximum difference between image pixel and model color | |
inHysteresis | float | 0.0 - | 0.0f | Defines how much the difference criterium is lowered for pixels neighboring with other foreground pixels | |
outRegion | Region& | Output region |
Hints
- Define the reference color by setting the inRgbColor input.
- Increase inChromaAmount to make the filter less sensitive to changes in brightness. Decrease it to make brightness more important.
- Set inMaxDifference experimentally to a value that best separates the foreground and background pixels.
Examples
Hardware Acceleration
This operation is optimized for SSE2 technology for pixels of types: 1xUINT8, 3xUINT8.
This operation supports automatic parallelization for multicore and multiprocessor systems.