9 #include "opencv2/xphoto.hpp" 17 (
"ShiftMap", cv::xphoto::INPAINT_SHIFTMAP);
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 int algorithmType = cv::xphoto::INPAINT_SHIFTMAP;
37 for (
int i=2; i<nrhs; i+=2) {
38 string key(rhs[i].toString());
40 algorithmType = InpaintTypeMap[rhs[i+1].toString()];
42 mexErrMsgIdAndTxt(
"mexopencv:error",
43 "Unrecognized option %s", key.c_str());
47 Mat src(rhs[0].toMat()),
48 mask(rhs[1].toMat(CV_8U)),
50 cv::xphoto::inpaint(src, mask, dst, algorithmType);
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.