pub fn compute_histogram(
data: &NDDataBuffer,
hist_size: usize,
hist_min: f64,
hist_max: f64,
) -> (Vec<f64>, f64, f64, f64)Expand description
Compute histogram of pixel values.
Returns (histogram, below_count, above_count, entropy).
hist_size: number of binshist_min/hist_max: value range for binning- bin index =
((val - hist_min) * (hist_size - 1) / (hist_max - hist_min) + 0.5) as usize - Values below
hist_minincrementbelow_count; abovehist_maxincrementabove_count - Entropy =
-sum(p * ln(p))for non-zero bins wherep = count / total_count