24 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
33 bool use_post_proc =
true;
34 float fgs_lambda = 500.0f;
35 float fgs_sigma = 1.5f;
36 for (
int i=2; i<nrhs; i+=2) {
37 string key(rhs[i].toString());
38 if (key ==
"GridStep")
39 grid_step = rhs[i+1].toInt();
42 else if (key ==
"Sigma")
43 sigma = rhs[i+1].toFloat();
44 else if (key ==
"UsePostProcessing")
45 use_post_proc = rhs[i+1].toBool();
46 else if (key ==
"FGSLambda")
47 fgs_lambda = rhs[i+1].toFloat();
48 else if (key ==
"FGSSigma")
49 fgs_sigma = rhs[i+1].toFloat();
52 "Unrecognized option %s", key.
c_str());
58 grid_step, k, sigma, use_post_proc, fgs_lambda, fgs_sigma);
struct mxArray_tag mxArray
Forward declaration for mxArray.
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
void calcOpticalFlowSparseToDense(InputArray from, InputArray to, OutputArray flow, int grid_step=8, int k=128, float sigma=0.05f, bool use_post_proc=true, float fgs_lambda=500.0f, float fgs_sigma=1.5f)