22 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=2);
33 bool crosscheck =
false;
34 for (
int i=2; i<nrhs; i+=2) {
35 string key(rhs[i].toString());
37 dtype = (rhs[i+1].isChar()) ?
39 else if (key ==
"NormType")
40 normType =
NormType[rhs[i+1].toString()];
43 else if (key ==
"Mask")
44 mask = rhs[i+1].toMat(
CV_8U);
45 else if (key ==
"Update")
46 update = rhs[i+1].toInt();
47 else if (key ==
"CrossCheck")
48 crosscheck = rhs[i+1].toBool();
51 "Unrecognized option %s", key.
c_str());
59 normType, K, mask, update, crosscheck);
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
struct mxArray_tag mxArray
Forward declaration for mxArray.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
void batchDistance(InputArray src1, InputArray src2, OutputArray dist, int dtype, OutputArray nidx, int normType=NORM_L2, int K=0, InputArray mask=noArray(), int update=0, bool crosscheck=false)
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.
const ConstMap< std::string, int > NormType
Norm type map for option processing.