Back to Adaptive Vision Library website
You are here: Start » Function Reference » Image Thresholding » ThresholdImage_Hysteresis
ThresholdImage_Hysteresis
Thresholds an image with a hysteresis, i.e. with a lower threshold for neighboring pixels.
Header: | AVL.h |
---|
Syntax
C++
C#
void avl::ThresholdImage_Hysteresis ( const avl::Image& inImage, atl::Optional<const avl::Region&> inRoi, atl::Optional<float> inMinValue, atl::Optional<float> inMaxValue, float inHysteresis, avl::Image& outMonoImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | const Image& | Input image | |||
inRoi | Optional<const Region&> | NIL | Region of interest | ||
inMinValue | Optional<float> | 128.0f | Minimum value of a pixel that is considered foreground (Auto = -INF) | ||
inMaxValue | Optional<float> | NIL | Maximum value of a pixel that is considered foreground (Auto = +INF) | ||
inHysteresis | float | 0.0 - | 16.0f | Defines how much the threshold criteria are lowered for pixels neighboring with other foreground pixels | |
outMonoImage | Image& |
Description
The operation transforms each pixel value to the maximum or minimum level thus creating binary image. The result of the transformation depends on the pixel intensity:
- Pixel values in range [inMinValue, inMaxValue] are transformed to the maximum level.
- Pixel values lower than inMinValue-inHysteresis or higher than inMaxValue+inHysteresis are transformed to the minimum level.
- Pixel values in range [inMinValue-inHysteresis, inMinValue) or in range (inMaxValue, inMaxValue+inHysteresis] are transformed to the maximum if (and only if) in the processed image there is a path of consecutive pixels of value in range [inMinValue-inHysteresis, inMaxValue+inHysteresis] that connects the pixel being considered and any pixel with value in range [inMinValue, inMaxValue].
In the multichannel images the operation uses an average of channel values in each pixel, thus the resulting image is always monochromatic.
Hints
- Define inMinValue to extract bright objects (brighter than the specified value).
- Define inMaxValue to extract dark objects (darker than the specified value).
- Use inHysteresis to allow weaker threshold for pixels neighboring with already extracted ones.
Examples
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
See Also
- ThresholdToRegion – Creates a region containing image pixels with values within the specified range.