OpenCV-Triangulation

Posted buaawang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenCV-Triangulation相关的知识,希望对你有一定的参考价值。

cv::triangulatePoints----Reconstucts points by triangulation

void cv::trangulatePoints (InputArray projMatr1, 
  InputArray projMatr2, 
  InputArray projPoints1, 
  InputArray projPoints2, 
  OutputArray points4D )

 

 

 

 

 

Python

 points4D=cv.triangulatePoints(projMatr1, projMatr2, projPoints1, projPoints2[, points4D])

 

Parameters

projMatr1 3x4 projection matrix of the first camera.
projMatr2 3x4 projection matrix of the second camera.
projPoints1 2xN array of feature points in the first image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
projPoints2 2xN array of corresponding points in the second image. In case of c++ version it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
points4D 4xN array of reconstructed points in homogeneous coordinates.

The function reconstructs 3-dimensional points (in homogeneout coordinates) by using their observations with a stereo camera. Projections matrices can be obtained from stereoRectify.

Note

Keep in mind that all input data should be of float type in order for this function to work.


 

在使用该函数进行三角化计算时,正如其Note所强调的,为了使该函数返回正常数值,所有的输入数据类型应该是float类型,且输出数据的类型也应该被当做float来使用,

实际操作中,在将齐次坐标points4D转换为非齐次坐标的过程中,由于使用double类型来操作,从而导致转换一直出错,该BUG找了好久才被找到,很心累。记录在此。

 

以上是关于OpenCV-Triangulation的主要内容,如果未能解决你的问题,请参考以下文章