简体   繁体   English

OpenCV中从2D到3D的转换矩阵

[英]Transformation matrix from 2D to 3D in opencv

I have some 2D points set (X,Y) corresponding to a 3D points set (X,Y,Z). 我有一些2D点集(X,Y)对应于3D点集(X,Y,Z)。 2D points were captured from camera and 3D points were the real coordinate according to world base. 从相机捕获2D点,而3D点是根据世界基础的真实坐标。 I want to find the transformation matrix between them, that is to say, how to convert other 2D points to 3D points. 我想找到它们之间的转换矩阵,也就是说,如何将其他2D点转换为3D点。

I have try getPespectiveTransform function, but it didnt work in this problem. 我尝试使用getPespectiveTransform函数,但是在此问题中没有奏效。

How can I write a regression to find this transform matrix ? 我如何编写回归来找到此变换矩阵?

You can use solvePnP of OpenCV , it gives you rotation and translation matrix. 您可以使用OpenCV solvePnP ,它为您提供旋转和平移矩阵。 In this answer you can see in more detail: Camera position in world coordinate from cv::solvePnP 在此答案中,您可以更详细地了解: 来自cv :: solvePnP的相机在世界坐标中的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM