19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
22 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=1);
25 vector<MxArray> rhs(prhs, prhs+nrhs);
29 for (
int i=3; i<nrhs; i+=2) {
30 string key(rhs[i].toString());
32 mask = rhs[i+1].toMat(CV_8U);
34 mexErrMsgIdAndTxt(
"mexopencv:error",
35 "Unrecognized option %s", key.c_str());
39 Mat src(rhs[0].toMat(rhs[0].isUint8() ? CV_8U : CV_32F)),
40 dst(rhs[1].toMat(rhs[1].isSingle() ? CV_32F : CV_64F));
41 double alpha = rhs[2].toDouble();
42 accumulateWeighted(src, dst, alpha, mask);
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.