I'm trying to solve an equation system using SVD: cv::SVD::solveZ(A, x);
, but A
needs to be a Matrix. OpenCV doesn't offer any convertion of a std::list
to cv::Mat
. So my question is, whether there is a smart way to convert it without having to convert the std::list
to a std::vector
before.
The Matrix A
is a 3xN matrix. My list contains N
cv::Point3d
elements.
My code looks something like this:
std::list<cv::Point3d> points; // length: N
cv::Mat A = cv::Mat(points).reshape(1); // that's how I do it with a std::vector<cv::Point3d>
cv::Mat x;
cv::SVD::solveZ(A, x); // homogeneous linear equation system Ax = 0
If anybody has an idea about it, then please tell me.