mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #22754 from mshabunin:c-cleanup
C-API cleanup for OpenCV 5.x (imgproc, highgui) * imgproc: C-API cleanup * imgproc: increase cvtColor test diff threshold * imgproc: C-API cleanup pt.2 * imgproc: C-API cleanup pt.3 * imgproc: C-API cleanup pt.4 * imgproc: C-API cleanup pt.5 * imgproc: C-API cleanup pt.5 * imgproc: C-API cleanup pt.6 * highgui: C-API cleanup * highgui: C-API cleanup pt.2 * highgui: C-API cleanup pt.3 * highgui: C-API cleanup pt.3 * imgproc: C-API cleanup pt.7 * fixup! highgui: C-API cleanup pt.3 * fixup! imgproc: C-API cleanup pt.6 * imgproc: C-API cleanup pt.8 * imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9 * fixup! imgproc: C-API cleanup pt.9
This commit is contained in:
@@ -204,9 +204,9 @@ receives three arguments:
|
||||
|
||||
We can choose any of three shapes for our kernel:
|
||||
|
||||
- Rectangular box: CV_SHAPE_RECT
|
||||
- Cross: CV_SHAPE_CROSS
|
||||
- Ellipse: CV_SHAPE_ELLIPSE
|
||||
- Rectangular box: Imgproc.SHAPE_RECT
|
||||
- Cross: Imgproc.SHAPE_CROSS
|
||||
- Ellipse: Imgproc.SHAPE_ELLIPSE
|
||||
|
||||
Together with the shape we specify the size of our kernel and the *anchor point*. If the anchor point is not
|
||||
specified, it is assumed to be in the center.
|
||||
|
||||
@@ -27,19 +27,19 @@ Theory
|
||||
(\f$d(H_{1}, H_{2})\f$) to express how well both histograms match.
|
||||
- OpenCV implements the function @ref cv::compareHist to perform a comparison. It also offers 4
|
||||
different metrics to compute the matching:
|
||||
-# **Correlation ( CV_COMP_CORREL )**
|
||||
-# **Correlation ( cv::HISTCMP_CORREL )**
|
||||
\f[d(H_1,H_2) = \frac{\sum_I (H_1(I) - \bar{H_1}) (H_2(I) - \bar{H_2})}{\sqrt{\sum_I(H_1(I) - \bar{H_1})^2 \sum_I(H_2(I) - \bar{H_2})^2}}\f]
|
||||
where
|
||||
\f[\bar{H_k} = \frac{1}{N} \sum _J H_k(J)\f]
|
||||
and \f$N\f$ is the total number of histogram bins.
|
||||
|
||||
-# **Chi-Square ( CV_COMP_CHISQR )**
|
||||
-# **Chi-Square ( cv::HISTCMP_CHISQR )**
|
||||
\f[d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)}\f]
|
||||
|
||||
-# **Intersection ( method=CV_COMP_INTERSECT )**
|
||||
-# **Intersection ( method=cv::HISTCMP_INTERSECT )**
|
||||
\f[d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I))\f]
|
||||
|
||||
-# **Bhattacharyya distance ( CV_COMP_BHATTACHARYYA )**
|
||||
-# **Bhattacharyya distance ( cv::HISTCMP_BHATTACHARYYA )**
|
||||
\f[d(H_1,H_2) = \sqrt{1 - \frac{1}{\sqrt{\bar{H_1} \bar{H_2} N^2}} \sum_I \sqrt{H_1(I) \cdot H_2(I)}}\f]
|
||||
|
||||
Code
|
||||
|
||||
Reference in New Issue
Block a user