15 (
"Scharr", CV_SCHARR);
25 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
28 nargchk((nrhs%2)==0 && nlhs<=2);
31 vector<MxArray> rhs(prhs, prhs+nrhs);
37 bool normalize =
false;
39 for (
int i=0; i<nrhs; i+=2) {
40 string key(rhs[i].toString());
42 dx = rhs[i+1].toInt();
44 dy = rhs[i+1].toInt();
45 else if (key==
"KSize")
46 ksize = (rhs[i+1].isChar()) ?
47 KSizeMap[rhs[i+1].toString()] : rhs[i+1].toInt();
48 else if (key==
"Normalize")
49 normalize = rhs[i+1].toBool();
50 else if (key==
"KType")
51 ktype = (rhs[i+1].isChar()) ?
54 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
59 getDerivKernels(kx, ky, dx, dy, ksize, normalize, ktype);
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.