public static double compare(ColorHistogram h1, ColorHistogram h2, String method) {
		
		// if two histograms are of different color spaces, they cannot be compared
		if (h1.getColorSpace().equals(h2.getColorSpace()) == false) {
			return -1;
		}
		
		int bin1[] = h1.getBins();
		int bin2[] = h2.getBins();
		if (bin1[0]!=bin2[0] || bin1[1]!=bin2[1] || bin1[2]!=bin2[2]) {
			return -1;
		}
		
		switch (method) {
		case "euclidean":
			return euclideanCompare(h1, h2);
		case "intersection":
			return intersectionCompare(h1, h2);
		case "quadratic":
			if (h1.getColorSpace() == ColorHelper.HSV) {
				System.out.println("HSV color space doesn't support this algorithm");
			}
			return quadraticCompare(h1, h2);
		default:
			System.out.println("The comparing method is not supported");
			break;
		}
		
		return -1;
	}