19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
22 nargchk((nrhs%2)==0 && nlhs<=1);
25 vector<MxArray> rhs(prhs, prhs+nrhs);
30 double theta = CV_PI*0.25;
33 double psi = CV_PI*0.5;
35 for (
int i=0; i<nrhs; i+=2) {
36 string key(rhs[i].toString());
38 ksize = rhs[i+1].toSize();
39 else if (key ==
"Sigma")
40 sigma = rhs[i+1].toDouble();
41 else if (key ==
"Theta")
42 theta = rhs[i+1].toDouble();
43 else if (key ==
"Lambda")
44 lambd = rhs[i+1].toDouble();
45 else if (key ==
"Gamma")
46 gamma = rhs[i+1].toDouble();
47 else if (key ==
"Psi")
48 psi = rhs[i+1].toDouble();
49 else if (key ==
"KType")
50 ktype = (rhs[i+1].isChar()) ?
53 mexErrMsgIdAndTxt(
"mexopencv:error",
54 "Unrecognized option %s", key.c_str());
58 Mat kernel = getGaborKernel(ksize, sigma, theta, lambd, gamma, psi, 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.