You are here: Start » FIL.NET » Function Reference » Image » Image Thresholding » FIL.SelectThresholdValue
Selects best threshold value using the image histogram.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
C++
C#
public static void SelectThresholdValue ( FilNet.Image inImage, NullableRef<FilNet.Region> inRoi, FilNet.ThresholdSelectionMethod inMethod, out float outThresholdValue, IList<float> diagThresholdRatings, IList<float> diagBackgroundPixelsFraction, IList<float> diagForegroundPixelsFraction )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inRoi | FilNet.NullableRef<FilNet.Region> | Range of pixels to be processed. Default value: ftl::NIL. | ||
![]() | inMethod | FilNet.ThresholdSelectionMethod | Method used to select the best threshold. | ||
![]() | outThresholdValue | float | Best threshold separating background pixels from foreground pixels. | ||
![]() | diagThresholdRatings | System.Collections.Generic.IList<float> | Contains ratings gained if that threshold would be chosen. | ||
![]() | diagBackgroundPixelsFraction | System.Collections.Generic.IList<float> | Fraction of pixels that are darker than the index value. | ||
![]() | diagForegroundPixelsFraction | System.Collections.Generic.IList<float> | 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.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Region exceeds an input image in SelectThresholdValue. |
DomainError | Not supported inImage pixel format in SelectThresholdValue. Supported formats: UInt8. |
Function Overrides
- SelectThresholdValue(Image, ThresholdSelectionMethod, Single)
- SelectThresholdValue(Image, NullableRef<Region>, ThresholdSelectionMethod, Single)