是否可以通过 2d-3d 点关系获得图像或相机位置的正面平行视图?

发布于 2024-12-26 15:09:36 字数 199 浏览 4 评论 0原文

是否可以使用 OpenCV 通过 2d-3d 点关系获得图像或相机位置的前平行视图?

为此,我有内在和外在参数。我还有图像上一组控制点(位于一个平面上)的 3d 坐标(关系 2d-3d)。

事实上,我需要相机的位置和方向,但如果我可以将图像转换为正面平行视图,那么找到它并不困难。

如果 OpenCV 无法完成,其他库可以解决此任务吗?

Is it possible to obtain front-parallel view of image or camera position by 2d-3d points relation using OpenCV?

For this I have intrinsic and extrinsic parameters. I have also 3d coordinates of set of control points (which lies in one plane) on image (relation 2d-3d).

In fact I need location and orientation of camera, but it is not difficult to find it if I can convert image to fronto-parallel view.

If it is not possible to do with OpenCV, are the other libraries which can solve this task?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫性小仙女 2025-01-02 15:09:36

解决方案基于 OpenCV 文档中的公式 相机标定和 3D 重建< /a>

让我们考虑没有失真系数的数值形式(与矩阵形式相反)。

我们有 uv
计算x'y'很容易。
但是xy无法计算,因为我们可以选择任何非零的z
3d 中的线对应于 2d 图像中的一个点。

为了解决这个问题,我们为 z=1z=2 取两个点。
然后我们在 3d 空间中找到 2 个点,分别指定线 (x1,y1,z1)(x2,y2,z2)

然后我们可以将 R-1 应用于 (x1,y1,z1)(x2,y2,z2) 结果是由两个点 (X1, Y1, Z1)(X1, Y1, Z1) 确定的线。

由于我们的控制点位于一个平面上(为了简单起见,让平面为 Z=0),我们可以找到相应的 XY 点,它们是 3d 中的一个点。

mm 归一化到像素后,我们获得了正面平行图像。

(如果我们的输入图像失真,我们应该首先将其恢复失真)

Solution is based on the formulas in the OpenCV documentation Camera Calibration and 3D Reconstruction

Let's consider numerical form without distortion coefficient (in contrast with matrix form).

We have u and v.
It is easy to calculate x' and y'.
But x and y can not be calculate because we can choose any non-zero z.
Line in 3d corresponds to one point in 2d image.

To solve this we take two points for z=1 and z=2.
Then we find 2 points in 3d space which specify line (x1,y1,z1) and (x2,y2,z2).

Then we can apply R-1 to (x1,y1,z1) and (x2,y2,z2) which results in line determined by two points (X1, Y1, Z1) and (X1, Y1, Z1).

Since our control points lie in one plane (let plane is Z=0 for simplicity) we can find corresponding X and Y point which is a point in 3d.

After applying normalization from mm to pixels we obtain fronto-parallel image.

(If we have input image distorted we should undistort it first)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文