You are here: Start » AVL.NET » AVL.ThresholdImage_Dynamic Method
AVL.ThresholdImage_Dynamic Method
Thresholds an image relatively to the average pixel value in a local rectangular neighborhood.
Namespace: | AvlNet |
---|---|
Assembly: | AVL.NET.dll |
Syntax
public static void ThresholdImage_Dynamic( AvlNet.Image inImage, AvlNet.Region inRoi, AvlNet.Region inSourceRoi, int inRadiusX, int? inRadiusY, float? inMinRelativeValue, float? inMaxRelativeValue, float inFuzziness, out AvlNet.Image outMonoImage, out AvlNet.Image diagBaseImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inImage | AvlNet.Image | Input image. | |||
inRoi | AvlNet.Region | Region in which pixels are written. Default value: atl::NIL, or null. | |||
inSourceRoi | AvlNet.Region | Region from which pixels are read. Default value: atl::NIL, or null. | |||
inRadiusX | int | <0, 65536> | 5 | Horizontal radius of internal mean blur. Default value: 5. | |
inRadiusY | int? | <0, 65536> | Vertical radius of internal mean blur (Auto = inRadiusX). Default value: atl::NIL, or null. | ||
inMinRelativeValue | float? | 5.0f | Minimum relative value of a pixel that is considered foreground (Auto = -INF). Default value: 5.0f, or null. | ||
inMaxRelativeValue | float? | Maximum relative value of a pixel that is considered foreground (Auto = +INF). Default value: atl::NIL, or null. | |||
inFuzziness | float | <0.0f, INF> | 0.0f | A tolerance for inMin/MaxRelativeValue that results in intermediate output values. Default value: 0.0f. | |
outMonoImage | AvlNet.Image | ||||
diagBaseImage | AvlNet.Image | Diagnostic blurred 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 relative pixel intensity:
- Pixel values that are brighter than local average of the pixel neighbourhood by at least inMinRelativeValue and at most inMaxRelativeValue are transformed to the maximum level.
- Other pixel values are transformed to the minimum level.
If any of the parameters inMinRelativeValue, inMaxRelativeValue is not set, it is assumed to be, accordingly, -infinity or infinity.
Pixel neighbourhood used to compute the local average is a rectangle of dimensions centered at the pixel being processed.
Parameter inFuzziness (set to 0 by default) allows to perform fuzzy thresholding which linearly interpolates those pixel values that differ by at most inFuzziness from the border intensities; thus creating smooth transition between minimum and maximum values in the resulting image.
In the multichannel images the operation uses an average of channel values in each pixel, thus the resulting image is always monochromatic.