Load cv triangulate points()
Hi everyone,
I am working on cv triangulatepoints(). I have keypoint values and projection matrix and I did tringulation using opencv function. But I could not able to load the points to point3d variable. I am getting error at double w = out.at<double>(3,0);
. I am trying to take x,y,z axis for one keypoint out of my 383 keypoints. Can anyone please suggest me.
int N = inp1.size();
cv::Mat out = cv::Mat(4,N, CV_64FC1);
cv::triangulatePoints( P, P1, inp1, inp2, out);
"out = " << out << endl;
w = out.at<double>(3,0);
x = out.at<double>(0,0)/w;
y = out.at<double>(1,0)/w;
z = out.at<double>(2,0)/w;
push_back(cv::Point3f(x,y,z));
Have you tried to change output to
cv::Mat(1,N,CV_64FC4)
?Yes, it didn't worked! The output from my program is 4xN matrix which has x,y,z,w values I want store this in vector list of double for individual axis. Now I am trying to store only for one keypoint.
Have you tried std::vector< cv::Point4d > ?
It is saying that vector<error type="">, is there point4d type ?
can you post the error too?
Have you seen this? Or maybe this one?
I have seen this. I was using code from "Multiple View Geometry in Computer Vision" but the output was not good... there are many confusions in that book.