In the histogram documentation, there are 4 (5) different comparison methods:
- CV_COMP_CORREL Correlation
- CV_COMP_CHISQR Chi-Square
- CV_COMP_INTERSECT Intersection
- CV_COMP_BHATTACHARYYA Distance Bhattacharya
- CV_COMP_HELLINGER Synonym for CV_COMP_BHATTACHARYYA
All of them give different outputs, which are read in different ways, as shown in the Comparison of the histogram documentation . But I canβt find anything that indicates how efficiently each method compares with each other. Of course, there are pros and cons for each method, otherwise why are there several methods?
Even OpenCV 2, "A Book on PC Software Programming," says very little about the differences:
Calling cv :: compareHist is simple. You simply enter two histograms, and the function returns the measured distance. the specific measurement method you want to use is indicated using the flag. The ImageComparator class uses the intersection method (with the CV_COMP_INTERSECT flag) . This method simply compares for each bin two values ββin each histogram and keeps a minimum. a measure of similarity is simply the sum of these minimum values. Therefore, two images having histograms without common colors would get an intersection value of 0, and two identical histograms would get a value equal to the total number of pixels.
Other available methods are Chi-Square (flag CV_COMP_CHISQR) which summarizes the normalized square difference between the bunkers, the correlation method (flag CV_COMP_CORREL) , which is based on the normalized cross-correlation operator used to process the signals, measure the similarity between the two signals, and Bhattacharya measurePYBAT ) used in statistics to assess the similarity between two probability distributions.
There should be differences between the methods, so my question is what is it? and under what circumstances do they work best?
source share