SelectThresholdValue
Selects best threshold value using the image histogram.
Applications:Usually used before a thresholding filter when the image brightness is variable. Use with care.
Syntax
C++
C#
Python
def SelectThresholdValue( inImage: Image, /, *, inRoi: Region | None = None, inMethod: ThresholdSelectionMethod = ThresholdSelectionMethod.ClusteringKittler ) -> ( outThresholdValue: float, diagThresholdRatings: list[float], diagBackgroundPixelsFraction: list[float], diagForegroundPixelsFraction: list[float] )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inImage | Image | Input image | |
![]() |
inRoi | Region | None | None | Range of pixels to be processed |
![]() |
inMethod | ThresholdSelectionMethod | ThresholdSelectionMethod.ClusteringKittler | Method used to select the best threshold |
![]() |
outThresholdValue | float | Best threshold separating background pixels from foreground pixels | |
![]() |
diagThresholdRatings | list[float] | Contains ratings gained if that threshold would be chosen | |
![]() |
diagBackgroundPixelsFraction | list[float] | Fraction of pixels that are darker than the index value | |
![]() |
diagForegroundPixelsFraction | list[float] | Fraction of pixels that are brighter than the index value |



