|
|
|
@ -213,82 +213,6 @@ CV_WRAP static inline void findCirclesGridDefault( InputArray image, Size patter |
|
|
|
|
{ |
|
|
|
|
findCirclesGrid(image, patternSize, centers, flags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
//! initializes camera matrix from a few 3D points and the corresponding projections.
|
|
|
|
|
CV_WRAP static inline Mat initCameraMatrix2D( const vector<Mat>& objectPoints, |
|
|
|
|
const vector<Mat>& imagePoints, |
|
|
|
|
Size imageSize, double aspectRatio=1. ) |
|
|
|
|
{ |
|
|
|
|
vector<vector<Point3f> > _objectPoints; |
|
|
|
|
vector<vector<Point2f> > _imagePoints; |
|
|
|
|
mv2vv(objectPoints, _objectPoints); |
|
|
|
|
mv2vv(imagePoints, _imagePoints); |
|
|
|
|
return initCameraMatrix2D(_objectPoints, _imagePoints, imageSize, aspectRatio); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CV_WRAP static inline double calibrateCamera( const vector<Mat>& objectPoints, |
|
|
|
|
const vector<Mat>& imagePoints, |
|
|
|
|
Size imageSize, |
|
|
|
|
CV_IN_OUT Mat& cameraMatrix, |
|
|
|
|
CV_IN_OUT Mat& distCoeffs, |
|
|
|
|
vector<Mat>& rvecs, vector<Mat>& tvecs, |
|
|
|
|
int flags=0 ) |
|
|
|
|
{ |
|
|
|
|
vector<vector<Point3f> > _objectPoints; |
|
|
|
|
vector<vector<Point2f> > _imagePoints; |
|
|
|
|
mv2vv(objectPoints, _objectPoints); |
|
|
|
|
mv2vv(imagePoints, _imagePoints); |
|
|
|
|
return calibrateCamera(_objectPoints, _imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, flags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CV_WRAP static inline double stereoCalibrate( const vector<Mat>& objectPoints, |
|
|
|
|
const vector<Mat>& imagePoints1, |
|
|
|
|
const vector<Mat>& imagePoints2, |
|
|
|
|
CV_IN_OUT Mat& cameraMatrix1, CV_IN_OUT Mat& distCoeffs1, |
|
|
|
|
CV_IN_OUT Mat& cameraMatrix2, CV_IN_OUT Mat& distCoeffs2, |
|
|
|
|
Size imageSize, CV_OUT Mat& R, CV_OUT Mat& T, |
|
|
|
|
CV_OUT Mat& E, CV_OUT Mat& F, |
|
|
|
|
TermCriteria criteria = TermCriteria(TermCriteria::COUNT+ |
|
|
|
|
TermCriteria::EPS, 30, 1e-6), |
|
|
|
|
int flags=CALIB_FIX_INTRINSIC ) |
|
|
|
|
{ |
|
|
|
|
vector<vector<Point3f> > _objectPoints; |
|
|
|
|
vector<vector<Point2f> > _imagePoints1; |
|
|
|
|
vector<vector<Point2f> > _imagePoints2; |
|
|
|
|
mv2vv(objectPoints, _objectPoints); |
|
|
|
|
mv2vv(imagePoints1, _imagePoints1); |
|
|
|
|
mv2vv(imagePoints2, _imagePoints2); |
|
|
|
|
return stereoCalibrate(_objectPoints, _imagePoints1, _imagePoints2, cameraMatrix1, distCoeffs1, |
|
|
|
|
cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, criteria, flags); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CV_WRAP static inline float rectify3Collinear( const Mat& cameraMatrix1, const Mat& distCoeffs1, |
|
|
|
|
const Mat& cameraMatrix2, const Mat& distCoeffs2, |
|
|
|
|
const Mat& cameraMatrix3, const Mat& distCoeffs3, |
|
|
|
|
const vector<Mat>& imgpt1, const vector<Mat>& imgpt3, |
|
|
|
|
Size imageSize, const Mat& R12, const Mat& T12, |
|
|
|
|
const Mat& R13, const Mat& T13, |
|
|
|
|
CV_OUT Mat& R1, CV_OUT Mat& R2, CV_OUT Mat& R3, |
|
|
|
|
CV_OUT Mat& P1, CV_OUT Mat& P2, CV_OUT Mat& P3, CV_OUT Mat& Q, |
|
|
|
|
double alpha, Size newImgSize, |
|
|
|
|
CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags ) |
|
|
|
|
{ |
|
|
|
|
vector<vector<Point2f> > _imagePoints1; |
|
|
|
|
vector<vector<Point2f> > _imagePoints3; |
|
|
|
|
mv2vv(imgpt1, _imagePoints1); |
|
|
|
|
mv2vv(imgpt3, _imagePoints3); |
|
|
|
|
return rectify3Collinear(cameraMatrix1, distCoeffs1, |
|
|
|
|
cameraMatrix2, distCoeffs2, |
|
|
|
|
cameraMatrix3, distCoeffs3, |
|
|
|
|
_imagePoints1, _imagePoints3, imageSize, |
|
|
|
|
R12, T12, R13, T13, R1, R2, R3, P1, P2, P3, |
|
|
|
|
Q, alpha, newImgSize, roi1, roi2, flags); |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|