30 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
36 double maxValue = 255;
41 for (
int i=1; i<nrhs; i+=2) {
42 string key(rhs[i].toString());
43 if (key ==
"MaxValue")
44 maxValue = rhs[i+1].toDouble();
45 else if (key ==
"Method")
47 else if (key ==
"Type")
48 thresholdType =
ThreshType[rhs[i+1].toString()];
49 else if (key ==
"BlockSize")
50 blockSize = rhs[i+1].toInt();
52 C = rhs[i+1].toDouble();
55 "Unrecognized option %s", key.
c_str());
void adaptiveThreshold(InputArray src, OutputArray dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C)
const ConstMap< std::string, int > ThreshType
Thresholding type map for option processing.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
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.
const ConstMap< string, int > AdaptiveMethod
Adaptive thresholding type map for option processing.
ADAPTIVE_THRESH_GAUSSIAN_C
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.