33 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
39 double maxValue = 255;
43 for (
int i=2; i<nrhs; i+=2) {
44 string key(rhs[i].toString());
45 if (key ==
"MaxValue")
46 maxValue = rhs[i+1].toDouble();
47 else if (key ==
"Type")
49 else if (key ==
"BlockSize")
50 blockSize = rhs[i+1].toInt();
51 else if (key ==
"Method")
55 "Unrecognized option %s", key.
c_str());
61 double k = rhs[1].toDouble();
const ConstMap< std::string, int > ThreshType
Thresholding type map for option processing.
void niBlackThreshold(InputArray _src, OutputArray _dst, double maxValue, int type, int blockSize, double k, int binarizationMethod=BINARIZATION_NIBLACK)
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...
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/output arguments number check.
Global constant definitions.
const ConstMap< string, int > BinarizationMethodsMap
binarization methods map for option processing
std::map wrapper with one-line initialization and lookup method.