如何从 calibrateCamera 结果中获取相机世界位置?

How do I obtain the camera world position from calibrateCamera results?

我正在使用 calibrateCamera 执行相机校准。部分输出是一组 Rodrigues 旋转矢量和 3-D 平移矢量。

我对摄像机的世界位置感兴趣。如果我直接绘制翻译点,结果看起来不正确。我觉得我的坐标空间很混乱,但我在解析 opencv 文档时遇到了问题:

rvecs – Output vector of rotation vectors (see Rodrigues() ) estimated for each pattern view. That is, each k-th rotation vector together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. M -1).

我的问题是,如何从 Rodrigues 旋转向量和使用 opencv 的 calibratecamera 获得的相应平移向量推导相机世界位置?

opencv docs:世界到相机坐标

那里有 2 个矩阵,the intrinsic matrix and the extrinsic matrix

如果您有 XYZ 坐标 在相机中(中心在中间),内在矩阵会为您提供图像中某物的 U、V 坐标(像素)坐标。外部矩阵根据世界坐标为您提供 XYZ 坐标 IN THE CAMERA

因此,您只需要 objective 的外部矩阵。

你知道你想要从相机中的XYZ到世界。由于外部矩阵是从世界到相机,你只需要反转它!

Cworld=E^(-1)*Ccamera

相机坐标系中的相机坐标为Ccamera=[0,0,0]

外部矩阵由 calibrateCamerarvectstvects 的两个输出组成。