23 nargchk(nrhs>=3 && (nrhs%2)==1 && nlhs<=3);
32 TermCriteria criteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01);
34 double minEigThreshold = 1e-4;
35 for (
int i=3; i<nrhs; i+=2) {
36 string key(rhs[i].toString());
37 if (key ==
"InitialFlow") {
38 nextPts = rhs[i+1].toVector<
Point2f>();
41 else if (key ==
"WinSize")
42 winSize = rhs[i+1].toSize();
43 else if (key ==
"MaxLevel")
44 maxLevel = rhs[i+1].toInt();
45 else if (key ==
"Criteria")
46 criteria = rhs[i+1].toTermCriteria();
47 else if (key ==
"GetMinEigenvals")
49 else if (key ==
"MinEigThreshold")
50 minEigThreshold = rhs[i+1].toDouble();
53 "Unrecognized option %s", key.
c_str());
59 if (rhs[0].isNumeric() && rhs[1].isNumeric()) {
64 (nlhs>2 ? err :
noArray()), winSize, maxLevel, criteria, flags,
67 else if (rhs[0].isCell() && rhs[1].isCell()) {
70 nextImg(rhs[1].toVector<Mat>());
72 (nlhs>2 ? err :
noArray()), winSize, maxLevel, criteria, flags,
struct mxArray_tag mxArray
Forward declaration for mxArray.
void calcOpticalFlowPyrLK(InputArray prevImg, InputArray nextImg, InputArray prevPts, InputOutputArray nextPts, OutputArray status, OutputArray err, Size winSize=Size(21, 21), int maxLevel=3, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags=0, double minEigThreshold=1e-4)
InputOutputArray noArray()
#define UPDATE_FLAG(NUM, TF, BIT)
set or clear a bit in flag depending on bool value
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...
OPTFLOW_LK_GET_MIN_EIGENVALS
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.