29 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
42 for (
int i=1; i<nrhs; i+=2) {
43 string key(rhs[i].toString());
45 ddepth = (rhs[i+1].isChar()) ?
47 else if (key ==
"XOrder")
48 dx = rhs[i+1].toInt();
49 else if (key ==
"YOrder")
50 dy = rhs[i+1].toInt();
51 else if (key ==
"KSize")
52 ksize = (rhs[i+1].isChar()) ?
53 KSizeMap[rhs[i+1].toString()] : rhs[i+1].toInt();
54 else if (key ==
"Scale")
55 scale = rhs[i+1].toDouble();
56 else if (key ==
"Delta")
57 delta = rhs[i+1].toDouble();
58 else if (key ==
"BorderType")
62 "Unrecognized option %s", key.
c_str());
67 Sobel(src, dst, ddepth, dx, dy, ksize, scale, delta, borderType);
const ConstMap< string, int > KSizeMap
KSize map for option processing.
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
struct mxArray_tag mxArray
Forward declaration for mxArray.
void Sobel(InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT)
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...
const ConstMap< std::string, int > BorderType
Border type map for option processing.
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.
std::map wrapper with one-line initialization and lookup method.