private static double[] getProbabilitiesOfColorLevel(Image img,
			ChannelType c) {
		double[] probabilities = new double[Image.MAX_VAL + 1];

		for (int x = 0; x < img.getWidth(); x++) {
			for (int y = 0; y < img.getHeight(); y++) {
				int aColorPixel = (int) img.getPixel(x, y, c);
				probabilities[aColorPixel]++;
			}
		}
		int size = (img.getWidth() * img.getHeight());
		for (int i = 0; i < probabilities.length; i++) {
			probabilities[i] /= size;
		}
		return probabilities;
	}