You are here: Start » AVL.NET » AVL.ThresholdToRegion_Dynamic(AvlNet.Image, AvlNet.Region, AvlNet.Region, int, int?, float?, float?, float, AvlNet.Region)

AVL.ThresholdToRegion_Dynamic(AvlNet.Image, AvlNet.Region, AvlNet.Region, int, int?, float?, float?, float, AvlNet.Region)

Thresholds an image relatively to the average pixel value in a local rectangular neighborhood.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void ThresholdToRegion_Dynamic(
	AvlNet.Image inImage,
	AvlNet.Region inRoi,
	AvlNet.Region inSourceRoi,
	int inRadiusX,
	int? inRadiusY,
	float? inMinRelativeValue,
	float? inMaxRelativeValue,
	float inHysteresis,
	out AvlNet.Region outRegion
)

Parameters

inImage
Type: AvlNet.Image
Input image
inRoi
Type: AvlNet.Region
Region in which pixels are written, or null.
inSourceRoi
Type: AvlNet.Region
Region from which pixels are read, or null.
inRadiusX
Type: System.Int32
Horizontal radius of internal mean blur
inRadiusY
Type: System.Nullable<System.Int32>
Vertical radius of internal mean blur (Auto = inRadiusX), or null.
inMinRelativeValue
Type: System.Nullable<System.Single>
Minimum relative value of a pixel that is considered foreground (Auto = -INF), or null.
inMaxRelativeValue
Type: System.Nullable<System.Single>
Maximum relative value of a pixel that is considered foreground (Auto = +INF), or null.
inHysteresis
Type: System.Single
Defines how much the threshold criteria are lowered for pixels neighboring with other foreground pixels
outRegion
Type: AvlNet.Region
Output region

Description

The operation is a cousin of ThresholdImage_Dynamic 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 local average. 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 (2 \cdot \text{\textbf{inRadiusX} }+1) \times (2 \cdot \text{\textbf{inRadiusY} }+1) centered at the pixel being processed.

In the multichannel images the operation uses an average of channel values in each pixel.

Examples

ThresholdToRegion_Dynamic performed on the sample image with inMinRelativeValue = 5.0, inMaxRelativeValue = auto.

See also