23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
29 int maxCorners = 1000;
30 double qualityLevel = 0.01;
31 double minDistance = 2.0;
35 bool useHarrisDetector =
false;
37 for (
int i=1; i<nrhs; i+=2) {
38 string key(rhs[i].toString());
39 if (key ==
"MaxCorners")
40 maxCorners = rhs[i+1].toInt();
41 else if (key ==
"QualityLevel")
42 qualityLevel = rhs[i+1].toDouble();
43 else if (key ==
"MinDistance")
44 minDistance = rhs[i+1].toDouble();
45 else if (key ==
"Mask")
46 mask = rhs[i+1].toMat(
CV_8U);
47 else if (key ==
"BlockSize")
48 blockSize = rhs[i+1].toInt();
49 else if (key ==
"GradientSize")
50 gradientSize = rhs[i+1].toInt();
51 else if (key ==
"UseHarrisDetector")
52 useHarrisDetector = rhs[i+1].toBool();
54 k = rhs[i+1].toDouble();
57 "Unrecognized option %s", key.
c_str());
64 mask, blockSize, gradientSize, useHarrisDetector, k);
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.
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
void goodFeaturesToTrack(InputArray image, OutputArray corners, int maxCorners, double qualityLevel, double minDistance, InputArray mask=noArray(), int blockSize=3, bool useHarrisDetector=false, double k=0.04)