17 (
"single2", CV_32FC2);
27 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
30 nargchk(nrhs>=4 && (nrhs%2)==0 && nlhs<=2);
33 vector<MxArray> rhs(prhs, prhs+nrhs);
38 for (
int i=4; i<nrhs; i+=2) {
39 string key(rhs[i].toString());
41 R = rhs[i+1].toMat(CV_64F);
42 else if (key==
"M1Type")
43 m1type = (rhs[i+1].isChar()) ?
44 M1Type[rhs[i+1].toString()] : rhs[i+1].toInt();
46 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
50 Mat cameraMatrix(rhs[0].toMat(CV_64F)),
51 distCoeffs(rhs[1].toMat(CV_64F)),
52 newCameraMatrix(rhs[2].toMat(CV_64F)),
54 Size size(rhs[3].toSize());
55 initUndistortRectifyMap(cameraMatrix, distCoeffs, R, newCameraMatrix,
56 size, m1type, map1, map2);
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.