17 (
"single2", CV_32FC2);
27 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
33 vector<MxArray> rhs(prhs, prhs+nrhs);
36 bool separate_variant = (nrhs>=2 && rhs[1].isNumeric());
37 nargchk((nrhs%2) == (separate_variant ? 0 : 1));
41 bool nninterpolation =
false;
42 for (
int i=(separate_variant ? 2 : 1); i<nrhs; i+=2) {
43 string key(rhs[i].toString());
44 if (key==
"DstMap1Type")
45 dstmap1type = (rhs[i+1].isChar()) ?
46 DstM1Type[rhs[i+1].toString()] : rhs[i+1].toInt();
47 else if (key==
"NNInterpolation")
48 nninterpolation = rhs[i+1].toBool();
50 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
54 Mat map1(rhs[0].toMat(rhs[0].isInt16() ? CV_16S : CV_32F)),
55 map2, dstmap1, dstmap2;
57 map2 = rhs[1].toMat(rhs[1].isUint16() ? CV_16U : CV_32F);
58 convertMaps(map1, map2, dstmap1, dstmap2, dstmap1type, nninterpolation);
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.