23 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
31 TermCriteria criteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001);
32 for (
int i=2; i<nrhs; i+=2) {
33 string key(rhs[i].toString());
35 winSize = rhs[i+1].toSize();
36 else if (key ==
"ZeroZone")
37 zeroZone = rhs[i+1].toSize();
38 else if (key ==
"Criteria")
39 criteria = rhs[i+1].toTermCriteria();
42 "Unrecognized option %s", key.
c_str());
47 if (rhs[1].isNumeric()) {
49 cornerSubPix(image, corners, winSize, zeroZone, criteria);
52 else if (rhs[1].isCell()) {
54 cornerSubPix(image, corners, winSize, zeroZone, criteria);
struct mxArray_tag mxArray
Forward declaration for mxArray.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
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 cornerSubPix(InputArray image, InputOutputArray corners, Size winSize, Size zeroZone, TermCriteria criteria)
Global constant definitions.