double compareHist(InputArray H1, InputArray H2, int method);
double compareHist(const SparseMat& H1, const SpareMat& H2, int method);
Parameters:
- H1
- First compared histogram.
- H2
- Second compared histogram of the same size as H1
- method
- CV_COMP_CORREL Correlation
- CV_COMP_CHISQR Chi-Square
- CV_COMP_INTERSECT Intersection
- CV_COMP_BHATTACHARYYA
- CV_COMP_HELLINGER
各种不同的method对两个直方图的差距计算不同。
- CV_COMP_INTERSECT,
- simply compares, for each bin, the two values in each histogram, and keeps the minimum one.
- two images having histograms with no colors in common would get an intersection value of 0, while two identical histograms would get a value equal to the total number of pixels.
-