|
|
|
@ -452,6 +452,20 @@ enum ContourApproximationModes { |
|
|
|
|
CHAIN_APPROX_TC89_KCOS = 4 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** @brief Shape matching methods
|
|
|
|
|
|
|
|
|
|
\f$A\f$ denotes object1,\f$B\f$ denotes object2 |
|
|
|
|
|
|
|
|
|
\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$ |
|
|
|
|
|
|
|
|
|
and \f$h^A_i, h^B_i\f$ are the Hu moments of \f$A\f$ and \f$B\f$ , respectively. |
|
|
|
|
*/ |
|
|
|
|
enum ShapeMatchModes { |
|
|
|
|
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]
|
|
|
|
|
CONTOURS_MATCH_I2 =2, //!< \f[I_2(A,B) = \sum _{i=1...7} \left | m^A_i - m^B_i \right |\f]
|
|
|
|
|
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]
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//! @} imgproc_shape
|
|
|
|
|
|
|
|
|
|
//! Variants of a Hough transform
|
|
|
|
@ -3915,7 +3929,7 @@ The function compares two shapes. All three implemented methods use the Hu invar |
|
|
|
|
|
|
|
|
|
@param contour1 First contour or grayscale image. |
|
|
|
|
@param contour2 Second contour or grayscale image. |
|
|
|
|
@param method Comparison method, see ::ShapeMatchModes |
|
|
|
|
@param method Comparison method, see cv::ShapeMatchModes |
|
|
|
|
@param parameter Method-specific parameter (not supported now). |
|
|
|
|
*/ |
|
|
|
|
CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2, |
|
|
|
|