25 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
28 nargchk(nrhs>=1 && (nrhs%2)==1 && nlhs<=1);
31 vector<MxArray> rhs(prhs, prhs+nrhs);
35 double sigmaColor = 50.0;
36 double sigmaSpace = 50.0;
37 int borderType = cv::BORDER_DEFAULT;
38 for (
int i=1; i<nrhs; i+=2) {
39 string key(rhs[i].toString());
42 else if (key==
"SigmaColor")
43 sigmaColor = rhs[i+1].toDouble();
44 else if (key==
"SigmaSpace")
45 sigmaSpace = rhs[i+1].toDouble();
46 else if (key==
"BorderType")
49 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
53 Mat src(rhs[0].toMat(rhs[0].isUint8() ? CV_8U : CV_32F)), dst;
54 bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, borderType);
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/ouput arguments number check.
Global constant definitions.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.