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 ; }
Computes the difference between two histograms using SAD .