diff --git a/modules/imgproc/doc/histograms.rst b/modules/imgproc/doc/histograms.rst index db731a87b..f576d5d75 100644 --- a/modules/imgproc/doc/histograms.rst +++ b/modules/imgproc/doc/histograms.rst @@ -174,10 +174,12 @@ Compares two histograms. * **CV_COMP_INTERSECT** Intersection * **CV_COMP_BHATTACHARYYA** Bhattacharyya distance + + * **CV_COMP_HELLINGER** Synonym for ``CV_COMP_BHATTACHARYYA`` The functions ``compareHist`` compare two dense or two sparse histograms using the specified method: -* Correlation (method=CV\_COMP\_CORREL) +* Correlation (``method=CV_COMP_CORREL``) .. math:: @@ -192,19 +194,19 @@ The functions ``compareHist`` compare two dense or two sparse histograms using t and :math:`N` is a total number of histogram bins. -* Chi-Square (method=CV\_COMP\_CHISQR) +* Chi-Square (``method=CV_COMP_CHISQR``) .. math:: d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)} -* Intersection (method=CV\_COMP\_INTERSECT) +* Intersection (``method=CV_COMP_INTERSECT``) .. math:: d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I)) -* Bhattacharyya distance (method=CV\_COMP\_BHATTACHARYYA) +* Bhattacharyya distance (``method=CV_COMP_BHATTACHARYYA`` or ``method=CV_COMP_HELLINGER``). In fact, OpenCV computes Hellinger distance, which is related to Bhattacharyya coefficient. .. math:: diff --git a/modules/imgproc/include/opencv2/imgproc/types_c.h b/modules/imgproc/include/opencv2/imgproc/types_c.h index 7637ee316..d7beed241 100644 --- a/modules/imgproc/include/opencv2/imgproc/types_c.h +++ b/modules/imgproc/include/opencv2/imgproc/types_c.h @@ -460,7 +460,8 @@ enum CV_COMP_CORREL =0, CV_COMP_CHISQR =1, CV_COMP_INTERSECT =2, - CV_COMP_BHATTACHARYYA =3 + CV_COMP_BHATTACHARYYA =3, + CV_COMP_HELLINGER =CV_COMP_BHATTACHARYYA }; /* Mask size for distance transform */