如果已知外部和内部参数,则从2D图像像素获得3D坐标 [英] Get 3D coordinates from 2D image pixel if extrinsic and intrinsic parameters are known

查看:465
本文介绍了如果已知外部和内部参数,则从2D图像像素获得3D坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做tsai algo的相机校准。我有intrensic和外在矩阵,但如何从该重建的三维坐标?

I am doing camera calibration from tsai algo. I got intrensic and extrinsic matrix, but how can I reconstruct the 3D coordinates from that inormation?


1)我可以使用Gaussian Elimination ,Y,Z,W,然后点将是均匀系统的X / W,Y / W,Z / W。

1) I can use Gaussian Elimination for find X,Y,Z,W and then points will be X/W , Y/W , Z/W as homogeneous system.

2)我可以使用
OpenCV文档方法:


>

2) I can use the OpenCV documentation approach:

我知道 u v R t ,我可以计算 X,Y,Z

as I know u, v, R , t , I can compute X,Y,Z.

但是,两种方法都会产生不正确的结果。

However both methods end up in different results that are not correct.

我做错了什么?

推荐答案

如果你有外在参数,那么你得到了一切。这意味着您可以从外部性(也称为CameraPose)拥有单应性。姿势是3x4矩阵,单应性是3x3矩阵, H 定义为

If you got extrinsic parameters then you got everything. That means that you can have Homography from the extrinsics (also called CameraPose). Pose is a 3x4 matrix, homography is a 3x3 matrix, H defined as

                   H = K*[r1, r2, t],       //eqn 8.1, Hartley and Zisserman

是相机内在矩阵, r1 r2 是旋转矩阵的前两列, R ; t 是翻译向量。

with K being the camera intrinsic matrix, r1 and r2 being the first two columns of the rotation matrix, R; t is the translation vector.

然后通过 t3 将所有内容归一化。

Then normalize dividing everything by t3.

r3 列会发生什么,我们不使用它吗?不,因为它是多余的,因为它是姿势的2个第一列的交叉乘积。

What happens to column r3, don't we use it? No, because it is redundant as it is the cross-product of the 2 first columns of pose.

现在你有单应性,投射点。你的2d点是x,y。添加他们a z = 1,所以他们现在是3d。投资他们如下:

Now that you have homography, project the points. Your 2d points are x,y. Add them a z=1, so they are now 3d. Project them as follows:

        p          = [x y 1];
        projection = H * p;                   //project
        projnorm   = projection / p(z);      //normalize

希望这有帮助。

这篇关于如果已知外部和内部参数,则从2D图像像素获得3D坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆