mexopencv  0.1
mex interface for opencv library
computeRecallPrecisionCurve.cpp
Go to the documentation of this file.
1 
8 #include "mexopencv.hpp"
10 #include "opencv2/features2d.hpp"
11 using namespace std;
12 using namespace cv;
13 
21 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
22 {
23  // Check the number of arguments
24  nargchk(nrhs==2 && nlhs<=1);
25 
26  // Argument vector
27  vector<MxArray> rhs(prhs, prhs+nrhs);
28 
29  // Process
30  //vector<vector<DMatch>> matches1to2(rhs[0].toVector<vector<DMatch>>());
31  vector<vector<DMatch> > matches1to2(rhs[0].toVector(
32  const_mem_fun_ref_t<vector<DMatch>, MxArray>(
33  &MxArray::toVector<DMatch>)));
34  vector<vector<uchar> > correctMatches1to2Mask(
35  MxArrayToVectorVectorPrimitive<uchar>(rhs[1]));
36  vector<Point2f> recallPrecisionCurve;
37  computeRecallPrecisionCurve(
38  matches1to2, correctMatches1to2Mask, recallPrecisionCurve);
39  plhs[0] = MxArray(Mat(recallPrecisionCurve,false).reshape(1,0)); // Nx2
40 }
mxArray object wrapper for data conversion and manipulation.
Definition: MxArray.hpp:123
void nargchk(bool cond)
Alias for input/ouput arguments number check.
Definition: mexopencv.hpp:166
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Common definitions for the features2d and xfeatures2d modules.
Global constant definitions.