1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #11703 from alalek:c_api_calib3d_chessboard_detector

This commit is contained in:
Alexander Alekhin
2018-07-09 15:37:26 +00:00
6 changed files with 911 additions and 927 deletions
@@ -409,6 +409,11 @@ IplConvKernelFP;
#define CV_MAT_MAGIC_VAL 0x42420000
#define CV_TYPE_NAME_MAT "opencv-matrix"
#ifdef __cplusplus
typedef struct CvMat CvMat;
CV_INLINE CvMat cvMat(const cv::Mat& m);
#endif
/** Matrix elements are stored row by row. Element (i, j) (i - 0-based row index, j - 0-based column
index) of a matrix can be retrieved or modified using CV_MAT_ELEM macro:
@@ -531,6 +536,16 @@ inline CvMat::CvMat(const cv::Mat& m)
step = (int)m.step[0];
type = (type & ~cv::Mat::CONTINUOUS_FLAG) | (m.flags & cv::Mat::CONTINUOUS_FLAG);
}
inline CvMat cvMat(const cv::Mat& m)
{
CvMat self;
CV_DbgAssert(m.dims <= 2);
self = cvMat(m.rows, m.dims == 1 ? 1 : m.cols, m.type(), m.data);
self.step = (int)m.step[0];
self.type = (self.type & ~cv::Mat::CONTINUOUS_FLAG) | (m.flags & cv::Mat::CONTINUOUS_FLAG);
return self;
}
#endif
@@ -916,6 +931,15 @@ CV_INLINE CvPoint2D32f cvPoint2D32f( double x, double y )
return p;
}
#ifdef __cplusplus
template<typename _Tp>
CvPoint2D32f cvPoint2D32f(const cv::Point_<_Tp>& pt)
{
CvPoint2D32f p((float)pt.x, (float)pt.y);
return p;
}
#endif
/** converts CvPoint to CvPoint2D32f. */
CV_INLINE CvPoint2D32f cvPointTo32f( CvPoint point )
{