19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
25 vector<MxArray> rhs(prhs, prhs+nrhs);
29 if (rhs[0].isNumeric() || rhs[0].isLogical()) {
31 Mat curve(rhs[0].toMat(
32 rhs[0].isUint8() || rhs[0].isLogical() ? CV_8U :
33 (rhs[0].isFloat() ? CV_32F : CV_32S)));
34 r = boundingRect(curve);
36 else if (rhs[0].isCell()) {
38 if (!rhs[0].isEmpty() && rhs[0].at<MxArray>(0).isFloat()) {
39 vector<Point2f> curve(rhs[0].toVector<Point2f>());
40 r = boundingRect(curve);
43 vector<Point> curve(rhs[0].toVector<Point>());
44 r = boundingRect(curve);
48 mexErrMsgIdAndTxt(
"mexopencv:error",
"Invalid input");
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.