23 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
31 int templateWindowSize = 7;
32 int searchWindowSize = 21;
34 for (
int i=1; i<nrhs; i+=2) {
35 string key(rhs[i].toString());
37 h = rhs[i+1].toFloat();
38 else if (key ==
"HColor")
39 hColor = rhs[i+1].toFloat();
40 else if (key ==
"TemplateWindowSize")
41 templateWindowSize = rhs[i+1].toInt();
42 else if (key ==
"SearchWindowSize")
43 searchWindowSize = rhs[i+1].toInt();
44 else if (key ==
"FlipChannels")
45 flip = rhs[i+1].toBool();
48 "Unrecognized option %s", key.
c_str());
53 if (
flip && (src.channels() == 3 || src.channels() == 4)) {
55 cvtColor(src, src, (src.channels()==3 ?
59 templateWindowSize, searchWindowSize);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
void fastNlMeansDenoisingColored(InputArray src, OutputArray dst, float h_luminance, float photo_render, int search_window=21, int block_size=7, Stream &stream=Stream::Null())
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.
Global constant definitions.
void flip(InputArray src, OutputArray dst, int flipCode)