9 #include "opencv2/ximgproc.hpp" 21 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
24 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
27 vector<MxArray> rhs(prhs, prhs+nrhs);
31 double sigmaColor = 25.0;
32 double sigmaSpace = 10.0;
33 int borderType = cv::BORDER_DEFAULT;
34 for (
int i=2; i<nrhs; i+=2) {
35 string key(rhs[i].toString());
36 if (key ==
"Diameter")
38 else if (key ==
"SigmaColor")
39 sigmaColor = rhs[i+1].toDouble();
40 else if (key ==
"SigmaSpace")
41 sigmaSpace = rhs[i+1].toDouble();
42 else if (key ==
"BorderType")
45 mexErrMsgIdAndTxt(
"mexopencv:error",
46 "Unrecognized option %s", key.c_str());
50 Mat src(rhs[0].toMat(rhs[0].isUint8() ? CV_8U : CV_32F)),
51 joint(rhs[1].toMat(rhs[1].isUint8() ? CV_8U : CV_32F)),
53 jointBilateralFilter(joint, src, dst,
54 d, sigmaColor, sigmaSpace, borderType);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
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.