9 #include "opencv2/photo.hpp" 16 (
"NS", cv::INPAINT_NS)
17 (
"Telea", cv::INPAINT_TELEA);
27 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
30 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
33 vector<MxArray> rhs(prhs, prhs+nrhs);
36 double inpaintRadius = 3.0;
37 int flags = cv::INPAINT_NS;
38 for (
int i=2; i<nrhs; i+=2) {
39 string key(rhs[i].toString());
41 inpaintRadius = rhs[i+1].toDouble();
42 else if (key==
"Method")
43 flags = InpaintType[rhs[i+1].toString()];
45 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
49 Mat src(rhs[0].toMat(CV_8U)),
50 mask(rhs[1].toMat(CV_8U)),
52 inpaint(src, mask, dst, inpaintRadius, flags);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Global constant definitions.
std::map wrapper with one-line initialization and lookup method.