You are here: Start » AVL.NET » AVL.SelectThresholdValue(AvlNet.Image, AvlNet.Region, AvlNet.ThresholdSelectionMethod, float, float[], float[], float[])

AVL.SelectThresholdValue(AvlNet.Image, AvlNet.Region, AvlNet.ThresholdSelectionMethod, float, float[], float[], float[])

Selects best threshold value using the image histogram.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void SelectThresholdValue(
	AvlNet.Image inImage,
	AvlNet.Region inRoi,
	AvlNet.ThresholdSelectionMethod inMethod,
	out float outThresholdValue,
	out float[] diagThresholdRatings,
	out float[] diagBackgroundPixelsFraction,
	out float[] diagForegroundPixelsFraction
)

Parameters

inImage
Type: AvlNet.Image
Input image
inRoi
Type: AvlNet.Region
Range of pixels to be processed, or null.
inMethod
Type: AvlNet.ThresholdSelectionMethod
Method used to select the best threshold
outThresholdValue
Type: System.Single
Best threshold separating background pixels from foreground pixels
diagThresholdRatings
Type: System.Single
Contains ratings gained if that threshold would be chosen
diagBackgroundPixelsFraction
Type: System.Single
Fraction of pixels that are darker than the index value
diagForegroundPixelsFraction
Type: System.Single
Fraction of pixels that are brighter than the index value

Description

The operation estimates an intensity threshold value that discriminates foreground pixels from background pixels in inImage.

Note that to provide meaningful results it is required that the image in fact consists of foreground and background components that strongly differ in brightness.

Examples

SelectThresholdValue performed on the sample image (on the left) with inMethod = ClusteringKittler yields outThresholdValue = 189.5. Pixels of the input image brighter than 189.5 are presented on the right.

See also