diff --git a/openbr/core/opencvutils.cpp b/openbr/core/opencvutils.cpp index 753daa8..25214b5 100644 --- a/openbr/core/opencvutils.cpp +++ b/openbr/core/opencvutils.cpp @@ -121,6 +121,17 @@ Mat OpenCVUtils::toMat(const QList &src, int rows) return dst; } +Mat OpenCVUtils::pointsToMatrix(const QList &qPoints) +{ + QList points; + foreach(const QPointF &point, qPoints) { + points.append(point.x()); + points.append(point.y()); + } + + return toMat(points); +} + Mat OpenCVUtils::toMat(const QList > &srcs, int rows) { QList flat; diff --git a/openbr/core/opencvutils.h b/openbr/core/opencvutils.h index 572e214..8632d39 100644 --- a/openbr/core/opencvutils.h +++ b/openbr/core/opencvutils.h @@ -84,6 +84,7 @@ namespace OpenCVUtils QPointF fromPoint(const cv::Point2f &cvPoint); QList toPoints(const QList &qPoints); QList fromPoints(const QList &cvPoints); + cv::Mat pointsToMatrix(const QList &qPoints); cv::Rect toRect(const QRectF &qRect); QRectF fromRect(const cv::Rect &cvRect); QList toRects(const QList &qRects);