mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -1036,9 +1036,10 @@ CV_INLINE void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color,
|
||||
int thickness CV_DEFAULT(1),
|
||||
int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) )
|
||||
{
|
||||
CvSize axes;
|
||||
axes.width = cvRound(box.size.width*0.5);
|
||||
axes.height = cvRound(box.size.height*0.5);
|
||||
CvSize axes = cvSize(
|
||||
cvRound(box.size.width*0.5),
|
||||
cvRound(box.size.height*0.5)
|
||||
);
|
||||
|
||||
cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,
|
||||
0, 360, color, thickness, line_type, shift );
|
||||
|
||||
@@ -410,7 +410,7 @@ typedef struct CvMoments
|
||||
double mu20, mu11, mu02, mu30, mu21, mu12, mu03; /**< central moments */
|
||||
double inv_sqrt_m00; /**< m00 != 0 ? 1/sqrt(m00) : 0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)
|
||||
CvMoments(){}
|
||||
CvMoments(const cv::Moments& m)
|
||||
{
|
||||
@@ -430,6 +430,36 @@ typedef struct CvMoments
|
||||
}
|
||||
CvMoments;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
CV_INLINE CvMoments cvMoments()
|
||||
{
|
||||
#if !defined(CV__ENABLE_C_API_CTORS)
|
||||
CvMoments self = CV_STRUCT_INITIALIZER; return self;
|
||||
#else
|
||||
return CvMoments();
|
||||
#endif
|
||||
}
|
||||
|
||||
CV_INLINE CvMoments cvMoments(const cv::Moments& m)
|
||||
{
|
||||
#if !defined(CV__ENABLE_C_API_CTORS)
|
||||
double am00 = std::abs(m.m00);
|
||||
CvMoments self = {
|
||||
m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03,
|
||||
m.mu20, m.mu11, m.mu02, m.mu30, m.mu21, m.mu12, m.mu03,
|
||||
am00 > DBL_EPSILON ? 1./std::sqrt(am00) : 0
|
||||
};
|
||||
return self;
|
||||
#else
|
||||
return CvMoments(m);
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/** Hu invariants */
|
||||
typedef struct CvHuMoments
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user