I am trying to triangulate some points with OpenCV and I found this cv::triangulatePoints()
function. The problem is that there is almost no documentation or examples of it.
I have some doubts about it.
What method does it use? I've making a small research about triangulations and there are several methods (Linear, Linear LS, eigen, iterative LS, iterative eigen,...) but I can't find which one is it using in OpenCV.
How should I use it? It seems that as an input it needs a projection matrix and 3xN homogeneous 2D points. I have them defined as
std::vector<cv::Point3d> pnts
, but as an output it needs 4xN arrays and obviously I can't create astd::vector<cv::Point4d>
because it doesn't exist, so how should I define the output vector?
For the second question I tried: cv::Mat pnts3D(4,N,CV_64F);
and cv::Mat pnts3d;
, neither seems to work (it throws an exception).