You are here: Start » Function Reference » Image Thresholding » ThresholdToRegion_Relative
ThresholdToRegion_Relative
Thresholds an image with a different threshold value for each pixel (inBaseImage(x, y) + inValue).
Syntax
void avl::ThresholdToRegion_Relative ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, const avl::Image& inBaseImage, atl::Optional<float> inMinRelativeValue, atl::Optional<float> inMaxRelativeValue, float inHysteresis, avl::Region& outRegion )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | const Image& | Input image | |||
inRoi | Optional<const Region&> | NIL | Region of interest | ||
inBaseImage | const Image& | Pixels of this image are subtracted from inImage before thresholding | |||
inMinRelativeValue | Optional<float> | 128.0f | Minimum relative value of a pixel that is considered foreground (Auto = -INF) | ||
inMaxRelativeValue | Optional<float> | NIL | Maximum relative value of a pixel that is considered foreground (Auto = +INF) | ||
inHysteresis | float | 0.0 - | 0.0f | Defines how much the threshold criteria are lowered for pixels neighboring with other foreground pixels | |
outRegion | Region& | Output region |
Description
The operation is a cousin of ThresholdImage_Relative yet computes a region instead of an image. The resulting region contains only those pixels of the input image, which are brighter at least by inMinRelativeValue and at most by inMaxRelativeValue than the corresponding pixel of inBaseImage. If any of the parameters inMinRelativeValue, inMaxRelativeValue is not set, it is assumed to be, accordingly, -infinity or infinity.
In the multichannel images the operation uses an average of channel values in each pixel.
Examples
ThresholdToRegion_Relative performed with inMinRelativeValue = 0.0, inMaxRelativeValue = auto.
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.