java.lang.Object
imagingbook.common.threshold.global.QuantileThresholder
- All Implemented Interfaces:
GlobalThresholder,Thresholder
- Direct Known Subclasses:
MedianThresholder
This is an implementation of the global "quantile" thresholder, described in Sec. 9.1 (Alg. 9.1) of [1]. Requires the
quantile (p) to be specified at instantiation. Method getThreshold(int[]) returns the minimal threshold that
will put AT LEAST the p-fraction of pixels (but not all pixels) in the background. If the underlying image is flat
(i.e., contains only a single pixel value), GlobalThresholder.NoThreshold is returned to indicate an invalid
threshold. Similarly there is no valid threshold if it takes the pixels from all brightness levels to fill the
p-quantile.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022). Also see the Errata p. 245!
- Version:
- 2022/08/22
-
Nested Class Summary
Nested classes/interfaces inherited from interface imagingbook.common.threshold.Thresholder
Thresholder.BackgroundMode -
Field Summary
Fields inherited from interface imagingbook.common.threshold.global.GlobalThresholder
NoThreshold -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetThreshold(int[] h) Returns a single (global) threshold value for the specified histogram.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface imagingbook.common.threshold.global.GlobalThresholder
getThreshold, threshold
-
Constructor Details
-
QuantileThresholder
-
-
Method Details
-
getThreshold
Description copied from interface:GlobalThresholderReturns a single (global) threshold value for the specified histogram.- Specified by:
getThresholdin interfaceGlobalThresholder- Parameters:
h- a histogram (array of frequencies)- Returns:
- a single (global) threshold value
-