25 nargchk(nrhs>=4 && (nrhs%2)==0 && nlhs<=8);
31 Mat cameraMatrix, distCoeffs;
33 TermCriteria criteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON);
34 for (
int i=4; i<nrhs; i+=2) {
35 string key(rhs[i].toString());
36 if (key ==
"CameraMatrix")
37 cameraMatrix = rhs[i+1].toMat(
CV_64F);
38 else if (key ==
"DistCoeffs")
39 distCoeffs = rhs[i+1].toMat(
CV_64F);
40 else if (key ==
"UseIntrinsicGuess")
42 else if (key ==
"FixPrincipalPoint")
44 else if (key ==
"FixFocalLength")
46 else if (key ==
"FixAspectRatio")
48 else if (key ==
"ZeroTangentDist")
50 else if (key ==
"FixTangentDist")
52 else if (key ==
"FixK1")
54 else if (key ==
"FixK2")
56 else if (key ==
"FixK3")
58 else if (key ==
"FixK4")
60 else if (key ==
"FixK5")
62 else if (key ==
"FixK6")
64 else if (key ==
"RationalModel")
66 else if (key ==
"ThinPrismModel")
68 else if (key ==
"FixS1S2S3S4")
70 else if (key ==
"TiltedModel")
72 else if (key ==
"FixTauXTauY")
74 else if (key ==
"UseLU")
76 else if (key ==
"UseQR")
78 else if (key ==
"Criteria")
79 criteria = rhs[i+1].toTermCriteria();
82 "Unrecognized option %s", key.
c_str());
93 Size imageSize(rhs[3].toSize());
95 Mat stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors;
97 board, imageSize, cameraMatrix, distCoeffs,
100 (nlhs>5 ? stdDeviationsIntrinsics :
noArray()),
101 (nlhs>6 ? stdDeviationsExtrinsics :
noArray()),
102 (nlhs>7 ? perViewErrors :
noArray()),
104 plhs[0] =
MxArray(cameraMatrix);
114 plhs[5] =
MxArray(stdDeviationsIntrinsics);
116 plhs[6] =
MxArray(stdDeviationsExtrinsics);
118 plhs[7] =
MxArray(perViewErrors);
CALIB_FIX_PRINCIPAL_POINT
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
CALIB_USE_INTRINSIC_GUESS
struct mxArray_tag mxArray
Forward declaration for mxArray.
Common definitions for the aruco module.
InputOutputArray noArray()
#define UPDATE_FLAG(NUM, TF, BIT)
set or clear a bit in flag depending on bool value
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
Global constant definitions.
double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, const Ptr< CharucoBoard > &board, Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, OutputArray stdDeviationsIntrinsics, OutputArray stdDeviationsExtrinsics, OutputArray perViewErrors, int flags=0, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON))
cv::Ptr< cv::aruco::CharucoBoard > create_CharucoBoard(std::vector< MxArray >::const_iterator first, std::vector< MxArray >::const_iterator last)
Create an instance of CharucoBoard using options in arguments.