File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
modules/imgproc/include/opencv2 Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,20 @@ enum ContourApproximationModes {
452
452
CHAIN_APPROX_TC89_KCOS = 4
453
453
};
454
454
455
+ /* * @brief Shape matching methods
456
+
457
+ \f$A\f$ denotes object1,\f$B\f$ denotes object2
458
+
459
+ \f$\begin{array}{l} m^A_i = \mathrm{sign} (h^A_i) \cdot \log{h^A_i} \\ m^B_i = \mathrm{sign} (h^B_i) \cdot \log{h^B_i} \end{array}\f$
460
+
461
+ and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively.
462
+ */
463
+ enum ShapeMatchModes {
464
+ CONTOURS_MATCH_I1 =1 , // !< \f[I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |\f]
465
+ CONTOURS_MATCH_I2 =2 , // !< \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f]
466
+ CONTOURS_MATCH_I3 =3 // !< \f[I_3(A,B) = \max _{i=1...7} \frac{ \left| m^A_i - m^B_i \right| }{ \left| m^A_i \right| }\f]
467
+ };
468
+
455
469
// ! @} imgproc_shape
456
470
457
471
// ! Variants of a Hough transform
@@ -3915,7 +3929,7 @@ The function compares two shapes. All three implemented methods use the Hu invar
3915
3929
3916
3930
@param contour1 First contour or grayscale image.
3917
3931
@param contour2 Second contour or grayscale image.
3918
- @param method Comparison method, see ::ShapeMatchModes
3932
+ @param method Comparison method, see cv ::ShapeMatchModes
3919
3933
@param parameter Method-specific parameter (not supported now).
3920
3934
*/
3921
3935
CV_EXPORTS_W double matchShapes ( InputArray contour1, InputArray contour2,
Original file line number Diff line number Diff line change @@ -501,15 +501,8 @@ enum
501
501
CV_POLY_APPROX_DP = 0
502
502
};
503
503
504
- /* * @brief Shape matching methods
505
-
506
- \f$A\f$ denotes object1,\f$B\f$ denotes object2
507
-
508
- \f$\begin{array}{l} m^A_i = \mathrm{sign} (h^A_i) \cdot \log{h^A_i} \\ m^B_i = \mathrm{sign} (h^B_i) \cdot \log{h^B_i} \end{array}\f$
509
-
510
- and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively.
511
- */
512
- enum ShapeMatchModes
504
+ /* * Shape matching methods */
505
+ enum
513
506
{
514
507
CV_CONTOURS_MATCH_I1 =1 , // !< \f[I_1(A,B) = \sum _{i=1...7} \left | \frac{1}{m^A_i} - \frac{1}{m^B_i} \right |\f]
515
508
CV_CONTOURS_MATCH_I2 =2 , // !< \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f]
You can’t perform that action at this time.
0 commit comments