从2D图像用单校准相机获得世界坐标 [英] Getting world coordinates from 2D image using single calibrated camera

查看:525
本文介绍了从2D图像用单校准相机获得世界坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从一个单一的图像校准我的相机没有一个棋盘。为此,我用下面的应用程序( http://w3.impa.br/ 〜臧/ qtcalib / index.html的),它使用蔡琴的方法来校准相机。

I am trying to calibrate my camera from a single image without a chessboard. To this end, I used the following application (http://w3.impa.br/~zang/qtcalib/index.html) which uses Tsai's method to calibrate the camera.

应用程序将返回intristic,旋转和平移矩阵。

The application returns intristic, rotation and translation matrix.

在这之后,我想计算世界从2D图像坐标。因此,与二维坐标(x,y)和矩阵(intristic,旋转,平移),我想获得的三维坐标(X,Y,Z)。喂我的程序

After that, I would like to calculate world coordinates from the 2d image. Thus, feeding my program with 2d coordinates (x,y) and the matrices (intristic, rotation, translation) I would like to get the 3D coordinates (X,Y,Z).

我跟一些相关的线程的指令(<一href="http://stackoverflow.com/questions/7836134/get-3d-coord-from-2d-image-pixel-if-we-know-extrinsic-and-intrinsic-parameters">get从2D图像像素3D坐标,如果我们知道外在和内在的参数的),但结果并不如我所期待的。另外,我不知道哪里是我的原点(0,0,0)。

I followed the instruction of some relative threads (get 3d coord from 2d image pixel if we know extrinsic and intrinsic parameters) but the results were not as I was expecting. Plus I have no idea where is my origin (0,0,0).

我是什么做错了吗?

推荐答案

该射影变换是

X = K * T * X

x = K * T * X

其中

K:内在
T:外在的(你的旋转和平移)。变换X转换成照相机坐标系。
X:在图像
像素坐标 X:三维坐标

K : intrinsic
T : extrinsic (your rotation and translation). Transforms X into the camera coordinate system.
x : pixel coordinate in image
X : 3D coordinate

投射二维像素三维比得上在三维空间中的线,因而有三维的无限多点可能。为了得到一个普通的三维坐标,你必须选择一个深度值。

Projecting a 2D pixel to 3D is comparable to a line in 3D space, thus there are an infinite number of 3D points possible. To get an ordinary 3D coordinate, you have to choose a depth value.

您可以决定你所得到的三维坐标原点:

You can decide your origin of the resulting 3D coordinate:

  • 摄像机坐标系,[0; 0; 0]为相机中心:
    X'= INV(K)* X

  • Camera coordinate system, [0;0;0] is at the camera center:
    X' = inv(K) * x

您棋盘或仔格的坐标系,[0; 0; 0]通常是在一个角落:
X'= INV(T)* INV(K)* X

Your chessboard or Tsai-grid coordinate system, [0;0;0] is usually at one of the corners:
X' = inv(T) * inv(K) * x

然而,如已经提到的,X'为更像一条线。你需要它的规模得到适当的三维坐标。

However, as already mentioned, X' is more like a line. You need to scale it to get a proper 3D coordinate.

它有时很难知道什么是仿射变换做。如果它不这样做你想要什么,咋工程的办法是与它的逆试试吧:)

It's sometimes difficult to know what a affine transformation is doing. In case it doesn't do what you want, a quick engineering approach could be to try it with its inverse :)

如果不帮你,你可以通过你的矩阵。

If that does not help you, you can pass your matrices.

这篇关于从2D图像用单校准相机获得世界坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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