23 keyline.
angle = arr.
at(
"angle", idx).toFloat();
24 keyline.
class_id = arr.
at(
"class_id", idx).toInt();
25 keyline.
octave = arr.
at(
"octave", idx).toInt();
26 keyline.
pt = arr.
at(
"pt", idx).toPoint2f();
27 keyline.
response = arr.
at(
"response", idx).toFloat();
28 keyline.
size = arr.
at(
"size", idx).toFloat();
29 keyline.
startPointX = arr.
at(
"startPoint", idx).toPoint2f().x;
30 keyline.
startPointY = arr.
at(
"startPoint", idx).toPoint2f().y;
31 keyline.
endPointX = arr.
at(
"endPoint", idx).toPoint2f().x;
32 keyline.
endPointY = arr.
at(
"endPoint", idx).toPoint2f().y;
37 keyline.
lineLength = arr.
at(
"lineLength", idx).toFloat();
59 "MxArray unable to convert to std::vector<cv::line_descriptor::KeyLine>");
74 nargchk(nrhs>=5 && (nrhs%2)==1 && nlhs<=1);
88 for (
int i=5; i<nrhs; i+=2) {
89 string key(rhs[i].toString());
90 if (key ==
"MatchColor")
91 matchColor = (rhs[i+1].isChar()) ?
92 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
93 else if (key ==
"SingleLineColor")
94 singleLineColor = (rhs[i+1].isChar()) ?
95 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
96 else if (key ==
"MatchesMask")
97 rhs[i+1].toMat(
CV_8S).reshape(1,1).copyTo(matchesMask);
98 else if (key ==
"NotDrawSingleLines")
101 else if (key ==
"OutImage") {
102 outImg = rhs[i+1].toMat(
CV_8U);
107 "Unrecognized option %s", key.
c_str());
118 if (matchesMask.
empty())
120 else if (matchesMask.
size() != matches1to2.
size())
123 matchColor, singleLineColor, matchesMask, flags);
KeyLine MxArrayToKeyLine(const MxArray &arr, mwIndex idx=0)
Convert an MxArray to cv::line_descriptor::KeyLine.
mwSize numel() const
Number of elements in an array.
T at(mwIndex index) const
Template for numeric array element accessor.
struct mxArray_tag mxArray
Forward declaration for mxArray.
vector< KeyLine > MxArrayToVectorKeyLine(const MxArray &arr)
Convert an MxArray to std::vector<cv::line_descriptor::KeyLine>
#define UPDATE_FLAG(NUM, TF, BIT)
set or clear a bit in flag depending on bool value
LIBMWMEX_API_EXTERN_C void mexErrMsgIdAndTxt(const char *identifier, const char *err_msg,...)
Issue formatted error message with corresponding error identifier and return to MATLAB prompt...
bool isCell() const
Determine whether input is cell array.
void drawLineMatches(const Mat &img1, const std::vector< KeyLine > &keylines1, const Mat &img2, const std::vector< KeyLine > &keylines2, const std::vector< DMatch > &matches1to2, Mat &outImg, const Scalar &matchColor=Scalar::all(-1), const Scalar &singleLineColor=Scalar::all(-1), const std::vector< char > &matchesMask=std::vector< char >(), int flags=DrawLinesMatchesFlags::DEFAULT)
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/output arguments number check.
bool isStruct() const
Determine whether input is structure array.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
Global constant definitions.
const ConstMap< std::string, cv::Scalar > ColorType
Translates MATLAB color names (see ColorSpec) into OpenCV scalars.
static Scalar_< double > all(double v0)