37 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=2);
41 bool with_labels = (nlhs > 1);
48 for (
int i=1; i<nrhs; i+=2) {
49 string key(rhs[i].toString());
50 if (key ==
"DistanceType")
51 distanceType =
DistType[rhs[i+1].toString()];
52 else if (key ==
"MaskSize")
53 maskSize = (rhs[i+1].isChar()) ?
54 DistMask[rhs[i+1].toString()] : rhs[i+1].toInt();
55 else if (with_labels && key ==
"LabelType")
57 else if (!with_labels && key ==
"DstType")
61 "Unrecognized option %s", key.
c_str());
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
void distanceTransform(InputArray src, OutputArray dst, OutputArray labels, int distanceType, int maskSize, int labelType=DIST_LABEL_CCOMP)
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.
const ConstMap< std::string, int > DistType
Distance types for Distance Transform and M-estimators.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.