15 (
"Rect", cv::MORPH_RECT)
16 (
"Cross", cv::MORPH_CROSS)
17 (
"Ellipse", cv::MORPH_ELLIPSE);
27 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
30 nargchk((nrhs%2)==0 && nlhs<=1);
33 vector<MxArray> rhs(prhs, prhs+nrhs);
36 int shape = cv::MORPH_RECT;
39 for (
int i=0; i<nrhs; i+=2) {
40 string key(rhs[i].toString());
42 shape = MorphShape[rhs[i+1].toString()];
43 else if (key==
"KSize")
44 ksize = rhs[i+1].toSize();
45 else if (key==
"Anchor")
46 anchor = rhs[i+1].toPoint();
48 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
52 Mat elem = getStructuringElement(shape, ksize, anchor);
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.
std::map wrapper with one-line initialization and lookup method.