22 nargchk(nrhs>=1 && (nrhs%2)!=0 && nlhs<=1);
28 double alpha = 1.0, beta = 0.0;
32 for (
int i=1; i<nrhs; i+=2) {
33 string key(rhs[i].toString());
35 alpha = rhs[i+1].toDouble();
36 else if (key ==
"Beta")
37 beta = rhs[i+1].toDouble();
38 else if (key ==
"NormType")
39 norm_type = (rhs[i+1].isChar()) ?
40 NormType[rhs[i+1].toString()] : rhs[i+1].toInt();
41 else if (key ==
"DType")
42 dtype = (rhs[i+1].isChar()) ?
44 else if (key ==
"Mask")
45 mask = rhs[i+1].toMat(
CV_8U);
46 else if (key ==
"Dest") {
47 dst = rhs[i+1].toMat();
52 "Unrecognized option %s", key.
c_str());
59 int dst_depth = (dtype < 0) ? src.
depth() : dtype;
64 normalize(src, dst, alpha, beta, norm_type, dtype, mask);
const ConstMap< std::string, int > ClassNameMap
Translates class name used in MATLAB to equivalent OpenCV depth.
void convertTo(OutputArray m, int rtype, double alpha=1, double beta=0) const
#define CV_MAKETYPE(depth, cn)
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...
static Vec< _Tp, cn > normalize(const Vec< _Tp, cn > &v)
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
void create(int rows, int cols, int type)
const ConstMap< std::string, int > NormType
Norm type map for option processing.