31 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=4);
40 for (
int i=1; i<nrhs; i+=2) {
41 string key(rhs[i].toString());
42 if (key ==
"Connectivity")
43 connectivity = rhs[i+1].toInt();
44 else if (key ==
"LType")
46 else if (key ==
"Method")
50 "Unrecognized option %s", key.
c_str());
59 connectivity, ltype, ccltype);
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.
int connectedComponents(InputArray image, OutputArray labels, int connectivity, int ltype, int ccltype)
const ConstMap< string, int > CCLAlgMap
Map type specification.
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.
int connectedComponentsWithStats(InputArray image, OutputArray labels, OutputArray stats, OutputArray centroids, int connectivity, int ltype, int ccltype)
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.