You are here: Start » AVL.NET » Function Reference » Image » Image Thresholding » AVL.ThresholdToRegion_Dynamic

AVL.ThresholdToRegion_Dynamic

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

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void ThresholdToRegion_Dynamic
(
	AvlNet.Image inImage,
	NullableRef<AvlNet.Region> inRoi,
	NullableRef<AvlNet.Region> inSourceRoi,
	int inRadiusX,
	int? inRadiusY,
	float? inMinRelativeValue,
	float? inMaxRelativeValue,
	float inHysteresis,
	AvlNet.Region outRegion,
	AvlNet.Image diagBaseImage
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inRoiAvlNet.NullableRef<AvlNet.Region>Region in which pixels are written. Default value: atl::NIL.
inSourceRoiAvlNet.NullableRef<AvlNet.Region>Region from which pixels are read. Default value: atl::NIL.
inRadiusXint<0, 65535>5Horizontal radius of internal mean blur. Default value: 5.
inRadiusYint?<0, 65535>Vertical radius of internal mean blur (Auto = inRadiusX). Default value: atl::NIL.
inMinRelativeValuefloat?5.0fMinimum relative value of a pixel that is considered foreground (Auto = -INF). Default value: 5.0f.
inMaxRelativeValuefloat?Maximum relative value of a pixel that is considered foreground (Auto = +INF). Default value: atl::NIL.
inHysteresisfloat<0.0f, INF>0.0fDefines how much the threshold criteria are lowered for pixels neighboring with other foreground pixels. Default value: 0.0f.
outRegionAvlNet.RegionOutput region.
diagBaseImageAvlNet.ImageDiagnostic blurred image.

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.

Errors

List of possible exceptions:

Error type Description
DomainError Region exceeds an input image in ThresholdToRegion_Dynamic.
DomainError Roi exceeds image dimensions in ThresholdToRegion_Dynamic.
DomainError Source roi exceeds image dimensions in ThresholdToRegion_Dynamic.

Function Overrides

See also