3D 建模问题 - 重温 [英] 3D modeling problem - revisited

查看:30
本文介绍了3D 建模问题 - 重温的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我之前发布的问题的后续,希望这次有更好的描述.

This is a follow-up to a previous question I posted, this time with a better description, I hope.

我制作了一副眼镜,上面装有针孔摄像头,可以记录人的眼球运动.相机位于眼睛下方,因此向上看眼睛.也有围绕 Y 轴(即相机略微向左或向右倾斜)和 Z 轴(即相机顺时针或逆时针略微扭曲)的轻微旋转.

I have made a pair of glasses that have a pinhole camera attached onto them that records the person's eye movements. The camera sits below the eye and is hence looking UP at the eye. There is also a slight rotation around the Y-axis (i.e. the camera has a slight left- or right-wards slant) and the Z-axis (i.e the camera is slightly twisted clock-wise or anti-clockwise).

从视频中,我提取了图像中的一组点,这些点应该看起来是大致线性的,但不是因为相机的方向不是直视人的眼睛.

From the video, I extract a set of points in the image, that should appear to be roughly linear but do not because the camera is not oriented to look straight at the person's eye.

如果我知道一个单位向量 U 来描述相机的方向以及相机正在寻找的图像点 IP1(x,y),如果相机是坐着的,我如何计算这些图像点的坐标在 (0, 0, -z) 处?

If I know of a unit vector U that describes the camera orientation as well as the image point IP1(x,y) where the camera is looking, how can I work out the coordinates of these image points if the camera was sitting at (0, 0, -z)?

推荐答案

这显然是一个不简单的摄影测量问题.摄影测量在技术大学的一门、两门或三门课程(1-3 个学期)中教授.

This is clearly a Photogrammetry problem which is not simple. Photogrammetry is taught in one, two or three classes (1-3 semesters) in technical universities.

首先,3维空间中的直线在相机拍摄的图像中被投影为(2维)直线(这与相机的方向无关).如果 3D 线确实是直的,而 2D 不是,那么相机不是公制"的,这意味着它会使图像失真.幸运的是,在大多数静态相机中,失真的主要原因可以通过直接线性变换方法 (DLT) 进行补偿.摄像机也应该如此,虽然我还没有验证过.

At first, a straight line in 3dimensional space is projected as a (2dimensional) straight line in the image shot by the camera (and this irrelevant to the orientation of the camera). If the 3D line is indeed straight, and the 2D is not, then the camera is not "metric", which means that it distorts the image. Luckily, the main causes of the distortion can be compensated for by the Direct Linear Transform method (DLT), in most still cameras. The same should be true for video cameras, though I have not verified it.

其次,如果您有图像上某个点的 x, y 坐标(2 个已知值),则无法计算同一点(3 个已知值)的 X,Y,Z 空间坐标.为了做到这一点,您必须有第二张不同方向的图像,其中同一点具有 x', y' 坐标(2 个已知点).然后您就可以计算 X、Y、Z 坐标 - 理论上.在实践中,计算很困难,因为它涉及非线性最小二乘法 (LSM).
您可能知道兴趣点位于一个表面(可能是眼睛的表面)上,而不是第二张图像.在这种情况下,点应满足形式为 f(X, Y, Z)=0 的曲面方程.将此等式与一幅图像的 x、y 坐标相结合,您就可以计算出 X、Y、Z 坐标.同样,计算并不简单.

Second, if you have the x, y coordinates of a point on the image (2 knowns), it is impossible to compute the X,Y,Z space coordinates of the same point (3 knowns). In order to do that, you must have a second image, of different orientation, where the same point has x', y' coordinates (2 knowns more). Then you are able to compute the X,Y,Z coordinates - in theory. In practice the computation is difficult because it involves non-linear Least Square Method (LSM).
Instead of a second Image, you may know that the points of interest lie on a surface (perhaps the surface of the eye). In this case the points should satisfy the equation of the surface which is of the form f(X, Y, Z)=0. With this equation combined with x, y coordinates of one image, you are able to compute the X, Y, Z coordinates. Again, the computations are not simple.

三、DLT方程定义为:

Third, the DLT equations are defined as:

     L1 X + L2 Y + L3 Z + L4
x = --------------------------
     L9 X + L10 Y + L11 Z + 1

     L5 X + L6 Y + L7 Z + L8
y = --------------------------
     L9 X + L10 Y + L11 Z + 1

如果您有至少 6 个控制点,则 Li 系数是未知的并且可以计算.控制点是图像上具有已知 X、Y、Z (3D) 坐标已知 x、y (2D) 坐标的点.

The Li coefficients are unknown and can be computed, if you have at least 6 control points. A control point is a point with known X, Y, Z (3D) coordinates and known x, y (2D) coordinates on the image.

计算 Li 后,您对第二张图像执行相同的操作,其方向与第一张图像不同.因此:

Once you compute Li, you do the same with a second image, whose orientation is different to the first image. Thus:

      L1' X + L2' Y + L3' Z + L4'
x' = -----------------------------
      L9' X + L10' Y + L11' Z + 1

      L5' X + L6' Y + L7' Z + L8'
y' = -----------------------------
      L9' X + L10' Y + L11' Z + 1

第四,现在您有了 Li 和 Li' 系数,您终于可以计算任意点的 X、Y、Z 坐标,该点对第一张图像的投影是 x、y,而对第二张图像的投影图像是 x', y'.您求解 X、Y、Z 的 4 个 DLT 方程.

Fourth, now that you have the Li and the Li' coefficients, you are finally able to compute the X, Y, Z coordinates of an arbitrary point whose projection to the first image is x, y and the projection to the second image is x', y'. You solve the 4 DLT equations for X, Y, Z.

最后,您可以使用控制曲线代替控制点,但这是一个活跃的研究领域.

As a last thought, you can use control curves instead of control points, but this a field of active research.

这篇关于3D 建模问题 - 重温的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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