22 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=2);
31 for (
int i=1; i<nrhs; i+=2) {
32 string key(rhs[i].toString());
34 mean = rhs[i+1].toMat();
37 else if (key ==
"Flags")
38 flags = rhs[i+1].toInt();
39 else if (key ==
"Scrambled") {
43 else if (key ==
"Normal")
45 else if (key ==
"UseAvg")
47 else if (key ==
"Scale")
49 else if (key ==
"Rows") {
53 else if (key ==
"Cols") {
57 else if (key ==
"CType")
58 ctype = (rhs[i+1].isChar()) ?
62 "Unrecognized option %s", key.
c_str());
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
Scalar mean(InputArray src, InputArray mask=noArray())
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
struct mxArray_tag mxArray
Forward declaration for mxArray.
#define UPDATE_FLAG(NUM, TF, BIT)
set or clear a bit in flag depending on bool value
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 calcCovarMatrix(const Mat *samples, int nsamples, Mat &covar, Mat &mean, int flags, int ctype=CV_64F)