code: protected double distanceHistogram(float histogramA[], float histogramB[]) {
  		double sumP = 0;
  		for( int i = 0; i < histogramA.length; i++ ) {
  			float q = histogramA[i];
  			float p = histogramB[i];
  			sumP += Math.abs(q-p);
  		}
  		return sumP;
  	}
docs: Computes the difference between two histograms using SAD.
  
  This is a change from the paper, which uses Bhattacharyya.  Bhattacharyya could give poor performance
  even with perfect data since two errors can cancel each other out.  For example, part of the histogram
  is too small and another part is too large.