是否有任何的算法来确定在这种情况下三维位置? (以下图片) [英] Is there any algorithm for determining 3d position in such case? (images below)

查看:118
本文介绍了是否有任何的算法来确定在这种情况下三维位置? (以下图片)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以首先我有这样的图像(和ofcourse我把所有点的二维坐标,所以我可以重新生成线,并检查他们互相交叉)

但是,嘿,我有同样的思路的另一幅图像(我知道大公相同)和我的观点一样对这个形象的新COORDS

所以......现在有了点第一个图像(COORDS),我怎么能determin平面旋转和Z深度的第二图像(asuming第一个中心在点(0,0,0),没有旋转)<? / P>

解决方案

让我这样说前面:这个问题很难。还有一个原因丹的故事的链接的问题没有得到回答。让我们为谁想要采取刺伤它的人一个交代。我希望我是错的是多么不容易,但。

我会假设2D屏幕坐标和投影/投影矩阵是众所周知的你。你需要知道至少有这么多(如果你不知道的投影矩阵,基本上是你用的是不同的相机看世界)。让我们把每对2D屏幕坐标(A_I,b_i),我将承担的投影矩阵的形式为

  P = [PX 0 0 0]
    [0 PY 0 0]
    [0 0 PZ PW]
    [0 0秒0],S = +/- 1
 

几乎任何合理的预测都有这种形式。通过渲染管道的工作,你会发现

  A_I = PX x_i /(S z_i)
b_i = PY y_i /(S z_i)
 

其中,(x_i,y_i,z_i)是点的原始3D坐标。

现在,让我们假设你知道在一组典型的坐标为(任何你想要的)你的形状,这样的顶点是(x0_i,y0_i,z0_i)。我们可以安排这些为矩阵 C 列。形状的实际坐标是这些坐标的刚性变换。让我们同样组织的实际坐标矩阵 V 列。然后,这些都是由相关

  V = R C + V 1 ^ T(*)
 

其中, 1 ^ T 是那些用正确长度的行向量,研究是一个正交旋转矩阵刚性的改造,而 v 是转型的偏移向量。

现在,你有一个EX pression为 V 从上面的每一列:第一列是 {S A_1 z_1 / PX ,S B_1 z_1 / PY,z_1} 等等。

您必须解决方程组(*)的组标量 z_i ,以及刚体变换定义研究 v

困难

  • 在该公式是非线性的未知数,涉及研究的智商和 z_i
  • 我们假设到现在为止,你知道哪些二维坐标中相对于原始形状的顶点(如果你的形状是方形,这是略少的问题)。
  • 我们假设甚至有一个在所有的解决方案;如果有在2D数据错误,那么就很难说有多好公式(*)就很满足了;改造将成为非刚性或非线性的。

So first of all I have such image (and ofcourse I have all points coordinates in 2d so I can regenerate lines and check where they cross each other)

But hey, I have another Image of same lines (I know thay are same) and new coords of my points like on this image

So... now Having points (coords) on first image, How can I determin plane rotation and Z depth on second image (asuming first one's center was in point (0,0,0) with no rotation)?

解决方案

Let me say this up front: this problem is hard. There is a reason Dan Story's linked question has not been answered. Let provide an explanation for people who want to take a stab at it. I hope I'm wrong about how hard it is, though.

I will assume that the 2D screen coordinates and projection/perspective matrix is known to you. You need to know at least this much (if you don't know the projection matrix, essentially you are using a different camera to look at the world). Let's call each pair of 2D screen coordinates (a_i, b_i), and I will assume the projection matrix is of the form

P = [ px  0  0  0 ]
    [ 0   py 0  0 ]
    [ 0   0  pz pw]
    [ 0   0  s  0 ], s = +/-1

Almost any reasonable projection has this form. Working through the rendering pipeline, you find that

a_i = px x_i / (s z_i)
b_i = py y_i / (s z_i)

where (x_i, y_i, z_i) are the original 3D coordinates of the point.

Now, let's assume you know your shape in a set of canonical coordinates (whatever you want), so that the vertices is (x0_i, y0_i, z0_i). We can arrange these as columns of a matrix C. The actual coordinates of the shape are a rigid transformation of these coordinates. Let's similarly organize the actual coordinates as columns of a matrix V. Then these are related by

V = R C + v 1^T             (*)

where 1^T is a row vector of ones with the right length, R is an orthogonal rotation matrix of the rigid transformation, and v is the offset vector of the transformation.

Now, you have an expression for each column of V from above: the first column is { s a_1 z_1 / px, s b_1 z_1 / py, z_1 } and so on.

You must solve the set of equations (*) for the set of scalars z_i, and the rigid transformation defined R and v.

Difficulties

  • The equation is nonlinear in the unknowns, involving quotients of R and z_i
  • We have assumed up to now that you know which 2D coordinates correspond to which vertices of the original shape (if your shape is a square, this is slightly less of a problem).
  • We assume there is even a solution at all; if there are errors in the 2D data, then it's hard to say how well equation (*) will be satisfied; the transformation will be nonrigid or nonlinear.

这篇关于是否有任何的算法来确定在这种情况下三维位置? (以下图片)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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