23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=3);
29 int groupThreshold = 1;
33 for (
int i=1; i<nrhs; i+=2) {
34 string key(rhs[i].toString());
36 groupThreshold = rhs[i+1].toInt();
37 else if (key ==
"EPS")
38 eps = rhs[i+1].toDouble();
39 else if (key ==
"Weights")
40 weights = rhs[i+1].toVector<
int>();
41 else if (key ==
"LevelWeights")
42 levelWeights = rhs[i+1].toVector<
double>();
45 "Unrecognized option %s", key.
c_str());
50 if ((!weights.
empty() && weights.
size() != rectList.
size()) ||
51 (!levelWeights.
empty() && levelWeights.
size() != rectList.
size()))
54 (nlhs>1 || !weights.
empty() ? &weights : NULL),
55 (nlhs>2 || !levelWeights.
empty() ? &levelWeights : NULL));
56 plhs[0] = (rhs[0].isNumeric()) ?
62 plhs[2] =
MxArray(levelWeights);
struct mxArray_tag mxArray
Forward declaration for mxArray.
Mat reshape(int cn, int rows=0) const
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.
void groupRectangles(std::vector< Rect > &rectList, int groupThreshold, double eps=0.2)
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.