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>=2 && (nrhs%2)==0 && nlhs<=1);
86 for (
int i=2; i<nrhs; i+=2) {
87 string key(rhs[i].toString());
89 color = (rhs[i+1].isChar()) ?
90 ColorType[rhs[i+1].toString()] : rhs[i+1].toScalar();
91 else if (key ==
"OutImage") {
92 outImage = rhs[i+1].toMat(
CV_8U);
97 "Unrecognized option %s", key.
c_str());
void drawKeylines(const Mat &image, const std::vector< KeyLine > &keylines, Mat &outImage, const Scalar &color=Scalar::all(-1), int flags=DrawLinesMatchesFlags::DEFAULT)
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.
KeyLine MxArrayToKeyLine(const MxArray &arr, mwIndex idx=0)
Convert an MxArray to cv::line_descriptor::KeyLine.
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 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/output arguments number check.
bool isStruct() const
Determine whether input is structure array.
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)
vector< KeyLine > MxArrayToVectorKeyLine(const MxArray &arr)
Convert an MxArray to std::vector<cv::line_descriptor::KeyLine>