1

I am trying to triangulate some points with opencv and I found this cv::triangulatePoints() function, but there is no much information about it. I've read I need the camera matrices, but I don't know how can I get it. I need the triangulation to choose the right rotation and translation matrix, so I can't calculate the camera matrix as C=K*[R|t] because I don't know which R and t matrices are the good ones.

The difference between my question and this one is that they know their camera matrices and R and t matrices, buy I don't know mines.

esencial=Kt*fundamental*K;
SVD descomp = SVD(esencial);
Mat U=descomp.u;
Mat Vt=descomp.vt;
Mat D=(Mat_<int>(3,3) << 1,0,0,0,1,0,0,0,0);

Mat nueva_E = U*D*Vt ;      
descomp = SVD(nueva_E);
U=descomp.u;
Vt=descomp.vt;

Mat R1; //dos posibles rotaciones
Mat R2;
Mat t1; //dos posibles traslaciones
Mat t2;
Mat W = (Mat_<int>(3,3) << 0,-1,0,1,0,0, 0,0,1);
Mat Z= (Mat_<int>(3,3)<<0,1,0,-1,0,0, 0,0,1);
R1 = U * Mat(W) * Vt;
R2 = U * Mat(Z) * Vt;
t1 = U.col(2); //u3
t2 = -U.col(2); //-u3

Now I thing I need the triangulation to choose one R and one t matrix

Community
  • 1
  • 1
anarp
  • 11
  • 3
  • @tux3 I've already read that one, but it says that I can calculate the camera matrix whit `R` and `t` but my problem is that I don't know `R` and `t` – anarp Mar 05 '15 at 19:11
  • 1
    you should be able to use [Singular Value Decomposition](https://en.wikipedia.org/wiki/Singular_value_decomposition) to get R and T, as said in the other thread. – tux3 Mar 05 '15 at 19:16
  • yes @tux3, I've done it, but I get 2 posibles `R` and `t` and now I have to choose one of them. That's why I'm using triangulation, to choose the good rotation and translation matrices. – anarp Mar 05 '15 at 19:19
  • @anarp This post is somewhat old, but why not just use `recoverPose` which will determine the correct R,t for you? It was introduced in OpenCV 3.0 – oarfish Jun 28 '15 at 19:19

0 Answers0