19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
22 nargchk(nrhs>=2 && (nrhs%2)==0 && nlhs<=1);
25 vector<MxArray> rhs(prhs, prhs+nrhs);
29 Scalar color(Scalar::all(-1));
30 int flags = DrawMatchesFlags::DEFAULT;
31 for (
int i=2; i<nrhs; i+=2) {
32 string key(rhs[i].toString());
34 color = rhs[i+1].toScalar();
35 else if (key==
"DrawRichKeypoints")
37 DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
38 else if (key==
"OutImage") {
39 outImg = rhs[i+1].toMat(CV_8U);
40 flags |= DrawMatchesFlags::DRAW_OVER_OUTIMG;
43 mexErrMsgIdAndTxt(
"mexopencv:error",
"Unrecognized option");
47 Mat image(rhs[0].toMat(CV_8U));
48 vector<KeyPoint> keypoints(rhs[1].toVector<KeyPoint>());
49 drawKeypoints(image, keypoints, outImg, color, flags);
#define UPDATE_FLAG(NUM, TF, BIT)
set or clear a bit in flag depending on bool value
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.