19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
22 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
25 vector<MxArray> rhs(prhs, prhs+nrhs);
29 for (
int i=3; i<nrhs; i+=2) {
30 string key(rhs[i].toString());
31 if (key==
"NewCameraMatrix")
32 newCameraMatrix = rhs[i+1].toMat(CV_64F);
34 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
38 Mat src(rhs[0].toMat()), dst,
39 cameraMatrix(rhs[1].toMat(CV_64F)),
40 distCoeffs(rhs[2].toMat(CV_64F));
41 undistort(src, dst, cameraMatrix, distCoeffs, newCameraMatrix);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.