消失点如何帮助恢复正确的相机视角?

发布于 2024-12-11 22:09:11 字数 156 浏览 0 评论 0原文

我正在尝试将 3D 对象插入到不是我拍摄的照片中。元信息被删除,所以我只能猜测相机参数和场景中物体的尺寸。在这种情况下如何设置合适的营地点,有什么方法吗?

我看到人们正在绘制辅助线,寻找消失点,但是虽然我理解消失点的含义,但我不明白它如何帮助恢复视角。关于这个主题有什么好的文章吗?

I'm trying to insert 3D object into a photo, that was not taken by me. Meta info is erased, so I can only guess camera parameters and dimensions of the objects in the scene. How can I set proper campoints in such case, is there any methodology?

I've seen that people are drawing helper lines, finding vanishing points, but while I understand the meaning of the vanishing point, I do not get how it can help in restoring the perspective. Any good writeup on the topic?

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

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

发布评论

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

评论(2

私野 2024-12-18 22:09:12

要从给定图像完全确定场景 3D 数据,您需要了解形成图像的透视投影参数。它们是:

  • 相机内在参数:焦距(必须!)和畸变参数(如果你想要高精度)

    • 相机外部参数(三个轴上的旋转/平移)

详细:
焦距可以从视角获得,公式为:fx = imageWidth/(2*tan(alphaX)),其他维度类似。如果您既没有 fx,也没有光圈,您无法重建 3D 图像。

提取它们的另一种方法是校准相机。请参阅http://opencv.itseez.com/modules/calib3d/doc/calib3d .html,但似乎您无法使用它(您说您无权访问相机。)

消失点(VP)用于确定相机定向的角度。因此,图像中心和 VP 之间的差异为您提供了旋转信息:

偏航 = ((camera.center.x (像素) - VP.x)/image.x )* 光圈。

间距=相似。

滚转角不能从 VP 中提取,而是从地平线中提取。

您需要的最后一个参数是翻译。根据应用程序,您可以将它们全部设置为 0,或者仅考虑高度相关。通常无法从图像中恢复它们。

现在,有了所有这些数据,您可以在这里查看
Opencv虚拟相机旋转/平移鸟瞰

看看所有这些措施如何影响你的透视校正。

To completely determine a scene 3D data from a given image, you need to know the perspective projection parameters that formed your image. They are:

  • camera intrinsics: focal length (a must!), and distortion parameters (if you want high precision)

    • camera extrinsic parameters (rotation/ translation on the three axes)

Detailed:
Focal length can be obtained from viewing angle, with this formula: fx = imageWidth/(2*tan(alphaX)), and similar for the other dimension. If you have neither fx, nor aperture, you cannot reconstruct your 3D image.

Another way to extract them is to calibrate the camera. See http://opencv.itseez.com/modules/calib3d/doc/calib3d.html, but it seems you cannot use it (you said you don't have access to camera.)

The vanishing point (VP) is used to determine the angles at which camera was orientated. So, a difference between the image center and the VP gives you the rotation info:

yaw = ((camera.center.x (pixels) - VP.x)/image.x )* aperture.

pitch = similar.

The roll angle cannot be extracted from VP, but from the horizon line.

The last parameters you need are the translations. Depending of the application, you can set them all 0, or consider only the height as being relevant. None of them can be usually recovered from the image.

Now, having all this data, you can look here
Opencv virtually camera rotating/translating for bird's eye view

to see how all this measures influence your perspective correction.

三生一梦 2024-12-18 22:09:12

这不是一个非常简单的话题,但请参阅此处 2 月 23 日的讲座:
https://courses.engr.illinois.edu/cs543/sp2017/

有不是一种万能的解决方案,但根据场景结构,通常可以将对象添加到照片中。另请参阅:http://dl.acm.org/itation.cfm?id=2024191

Not a very simple topic, but see the Feb 23 lecture here:
https://courses.engr.illinois.edu/cs543/sp2017/

There is not a one-size-fits-all solution, but depending on scene structure, it is often possible to add objects to photos. See also: http://dl.acm.org/citation.cfm?id=2024191

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