#include <cv.h>
#include <highgui.h>
#include <mat.h>
#include <mex.h>
#include "MxArray.hpp"
class NewRFFeatureGetter : public cv::RFFeatureGetter
{
public:
NewRFFeatureGetter() : name("NewRFFeatureGetter"){}
virtual void getFeatures(
const cv::Mat &src, NChannelsMat &features,
const int gnrmRad, const int gsmthRad,
const int shrink, const int outNum, const int gradNum) const
{
}
protected:
};
MEXFUNCTION_LINKAGE void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
if (nlhs != 1) mexErrMsgTxt("nlhs != 1");
如果 (nrhs != 1) mexErrMsgTxt("nrhs != 1");
cv::Mat src = MxArray(prhs[0]).toMat();
std::string modelFile = MxArray(prhs[1]).toString();
NewRFFeatureGetter *pDollar = createNewRFFeatureGetter();
pDollar->getFeatures(src, edges, 4, 0, 2, 13, 4);
plhs[0] = MxArray(edges);
}
OpenCV 原始数据类型的模板“特性”类。
定义 traits.hpp:113
void convertTo(OutputArray m, int rtype, double alpha=1, double beta=0) const
以可选缩放方式将数组转换为另一种数据类型。
std::string String
定义 cvstd.hpp:151