java.lang.Object
imagingbook.common.histogram.PiecewiseLinearCdf
This class represents a discrete "cumulative distribution function" that is piecewise linear. See Sec. 3.6.3 (Fig. 3.12) of [1] for additional details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
-
Constructor Summary
ConstructorsConstructorDescriptionPiecewiseLinearCdf
(int K, int[] a, double[] b) Constructor, creates aPiecewiseLinearCdf
from a sequence of brightness / cumulative probability pairs. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getCdf()
Returns the cumulative probabilities for the intensity values 0 to 255 as adouble[]
.double
getCdf
(int i) Returns the cumulative probability for the specified intensity value.double
getInverseCdf
(double P) Returns the inverse cumulative probability function a = P-1(a), that is, the intensity value a associated with a given cum.double[]
getPdf()
Returns the probability function for this distribution as a discrete array of probabilities.
-
Constructor Details
-
PiecewiseLinearCdf
Constructor, creates a
PiecewiseLinearCdf
from a sequence of brightness / cumulative probability pairs. See Sec. 3.6.3 (Fig. 3.12) of [1] for additional details. Usage example:int[] ik = {28, 75, 150, 210}; double[] Pk = {.05, .25, .75, .95}; PiecewiseLinearCdf pLCdf = new PiecewiseLinearCdf(256, ik, Pk);
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Parameters:
K
- number of brightness values (typ. 256)a
- a sequence of brightness values serving as control pointsb
- a sequence of cumulative probability values in [0,1], one for each control point
-
-
Method Details
-
getCdf
Returns the cumulative probability for the specified intensity value.- Parameters:
i
- the intensity value- Returns:
- the associated cumulative probability
-
getCdf
Returns the cumulative probabilities for the intensity values 0 to 255 as adouble[]
.- Returns:
- the array of cumulative probabilities
-
getInverseCdf
Returns the inverse cumulative probability function a = P-1(a), that is, the intensity value a associated with a given cum. probability P.- Parameters:
P
- a cumulative probability- Returns:
- the associated intensity
-
getPdf
Returns the probability function for this distribution as a discrete array of probabilities.- Returns:
- the probability array
-