int value = (int) (image.getColor(i).getComponents()[0]*(binsCounts[i]-1));
int value = Math.min((int)(image.getColor(i).getComponents()[0]*binsCounts[i]),binsCounts[i]-1);
	public FuzzyHistogram(Image image, int[] binsCounts) {		if (image == null)			throw new NullPointerException("image == null");		if (binsCounts == null)			throw new NullPointerException("binsCounts == null");		if (image.getColorComponentsCount() != binsCounts.length)			throw new IllegalArgumentException("binsCounts must have " 					+ image.getColorComponentsCount() + " components");				histogram = new HashMap();		elementsCount = binsCounts[0];		for (int i = 1; i < image.getColorComponentsCount(); i++)			elementsCount *= binsCounts[i];				int pc = image.getWidth() * image.getHeight();		for (int i = 0; i < pc; i++) {			int value = (int) (image.getColor(i).getComponents()[0]*(binsCounts[i]-1));			Integer index = new Integer(value);			Integer prev = (Integer)histogram.get(index);			if (prev == null) prev = new Integer(0);						int newValue = prev.intValue()+1;			histogram.put(index, new Integer(newValue));			if (newValue > max) max = newValue;		}	}