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

AVL.ThresholdToRegion_HSx

Creates a region containing image pixels which belongs to specified region in HSV, HSL or HSI space.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void ThresholdToRegion_HSx
(
	AvlNet.Image inRgbImage,
	NullableRef<AvlNet.Region> inRoi,
	AvlNet.HSxColorModel inColorModel,
	int inBeginHue,
	int inEndHue,
	int? inMinSaturation,
	int? inMaxSaturation,
	int? inMinBrightness,
	int? inMaxBrightness,
	AvlNet.Region outRegion
)

Parameters

Name Type Range Default Description
inRgbImageAvlNet.Image
inRoiAvlNet.NullableRef<AvlNet.Region>Range of pixels to be processed. Default value: atl::NIL.
inColorModelAvlNet.HSxColorModelSelected color model.
inBeginHueint<0, 255>0Lowest acceptable Hue; if higher than inEndHue, then range wrapping is used. Default value: 0.
inEndHueint<0, 255>255Highest acceptable Hue, if lower than inBeginHue, then range wrapping is used. Default value: 255.
inMinSaturationint?<0, 255>128Default value: 128.
inMaxSaturationint?<0, 255>
inMinBrightnessint?<0, 255>128Minimum brightness; denotes V, L or I, depending on inColorModel. Default value: 128.
inMaxBrightnessint?<0, 255>Maximum brightness; denotes V, L or I, depending on inColorModel. Default value: atl::NIL.
outRegionAvlNet.RegionOutput region.

Description

The operation is a cousin of ThresholdImage_HSx yet it computes a region instead of an image. The three-channel inRgbImage is considered to be encoded using RGB color representation. Each of the image pixel is internally converted to HSx (HSV, HSL or HSI) color representation and then examined. The resulting region contains only those pixels of the input image, which meets all of the following conditions:

  • Value of the Hue parameter is in cyclic range (inBeginHue, inEndHue).
  • Value of the Saturation parameter is in range (inMinSaturation, inMaxSaturation).
  • Value of the Value parameter is in range (inMinBrightness, inMaxBrightness).

If any of the parameters inMinSaturation, inMinBrightness is not set, it is assumed to be -infinity.

If any of the parameters inMaxSaturation, inMaxBrightness is not set, it is assumed to be infinity.

Examples

ThresholdToRegion_HSx performed on the sample image with inColorModel = HSV, inBeginHue = 0.0, inEndHue = 10.0, inMinSaturation = 120.0, inMinBrightness = 70.0.

Hardware Acceleration

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 Not a 3-channel and 8-bit image in ThresholdToRegion_HSx.
DomainError Region exceeds an input image in ThresholdToRegion_HSx.
DomainError Not supported inRgbImage pixel format in ThresholdToRegion_HSx. Supported formats: 3xUInt8.

Function Overrides

See also