/** * Computes the variance of pixel intensity values for a GrayU8 image represented by the given histogram. * * @param histogram Histogram with N bins * @param mean Mean of the image. * @param N number of bins in the histogram. * @return variance */ public static double variance(int[] histogram, double mean , int N ) { return variance(histogram, mean, count(histogram,N), N); }