23 nargchk(nrhs>=4 && (nrhs%2)==0 && nlhs<=2);
31 for (
int i=4; i<nrhs; i+=2) {
32 string key(rhs[i].toString());
33 if (key ==
"DistCoeffs")
34 D = rhs[i+1].toMat(
CV_64F);
35 else if (key ==
"Alpha")
36 alpha = rhs[i+1].toDouble();
39 "Unrecognized option %s", key.
c_str());
47 if (rhs[0].isNumeric()) {
51 rvec, tvec, K, D, alpha, (nlhs>1 ? jacobian :
noArray()));
52 if (objectPoints.channels() == 1 && objectPoints.cols == 3)
53 imagePoints = imagePoints.
reshape(1,0);
56 else if (rhs[0].isCell()) {
60 rvec, tvec, K, D, alpha, (nlhs>1 ? jacobian :
noArray()));
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
struct mxArray_tag mxArray
Forward declaration for mxArray.
Mat reshape(int cn, int rows=0) const
InputOutputArray noArray()
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.
void projectPoints(InputArray objectPoints, InputArray rvec, InputArray tvec, InputArray cameraMatrix, InputArray distCoeffs, OutputArray imagePoints, OutputArray jacobian=noArray(), double aspectRatio=0)