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

AVL.ThresholdToRegion_Relative

Thresholds an image with a different threshold value for each pixel (inBaseImage(x, y) + inValue).

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void ThresholdToRegion_Relative
(
	AvlNet.Image inImage,
	NullableRef<AvlNet.Region> inRoi,
	AvlNet.Image inBaseImage,
	float? inMinRelativeValue,
	float? inMaxRelativeValue,
	float inHysteresis,
	AvlNet.Region outRegion
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inRoiAvlNet.NullableRef<AvlNet.Region>Region of interest. Default value: atl::NIL.
inBaseImageAvlNet.ImagePixels of this image are subtracted from inImage before thresholding.
inMinRelativeValuefloat?128.0fMinimum relative value of a pixel that is considered foreground (Auto = -INF). Default value: 128.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.

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

A sample image used as inImage.

A sample image used as inBaseImage.

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 is optimized for NEON technology for pixels of types: 1xUINT8, 3xUINT8.

This operation supports automatic parallelization for multicore and multiprocessor systems.

Hardware acceleration settings may be manipulated with Settings class.

Errors

List of possible exceptions:

Error type Description
DomainError Image formats are not the same in ThresholdToRegion_Relative.
DomainError Image sizes are not equal in ThresholdToRegion_Relative.
DomainError Region exceeds an input image in ThresholdToRegion_Relative.

Function Overrides

See also