28 bool diff_variant = (nrhs>1 && rhs[1].isNumeric());
29 nargchk((nrhs%2) == (diff_variant ? 0 : 1));
33 bool relative =
false;
35 for (
int i=(diff_variant ? 2 : 1); i<nrhs; i+=2) {
36 string key(rhs[i].toString());
37 if (key ==
"NormType")
38 normType =
NormType[rhs[i+1].toString()];
39 else if (key ==
"Relative")
40 relative = rhs[i+1].toBool();
41 else if (key ==
"Mask")
42 mask = rhs[i+1].toMat(
CV_8U);
45 "Unrecognized option %s", key.
c_str());
54 nrm =
norm(src1, src2, normType, mask);
57 nrm =
norm(src1, normType, mask);
static double norm(const Matx< _Tp, m, n > &M)
struct mxArray_tag mxArray
Forward declaration for mxArray.
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 mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
const ConstMap< std::string, int > NormType
Norm type map for option processing.