如何将投影的 3D 矩形转换为 2D 轴对齐矩形
我有一个 3D 矩形的图像(由于投影失真,它不是图像中的矩形)。我知道这个矩形所有角的所有世界坐标和图像坐标。
我需要的是确定该矩形内图像中的点的世界坐标。为此,我需要计算一个变换,将该矩形取消投影为 2D 矩形。
我如何计算该变换?
提前致谢
I have an image of a 3D rectangle (which due to the projection distortion is not a rectangle in the image). I know the all world and image coordinates of all corners of this rectangle.
What I need is to determine the world coordinate of a point in the image inside this rectangle. To do that I need to compute a transformation to unproject that rectangle to a 2D rectangle.
How can I compute that transform?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是查找保留直线的四边形之间的映射的特殊情况。这些通常称为单应变换。在这里,其中一个四边形是矩形,因此这是一种流行的特殊情况。您可以通过谷歌搜索这些术语(“四元到四元”等)来查找解释和代码,但这里有一些适合您的网站。
透视变换估计
游戏论坛讨论
将四边形图像提取到矩形
投影变形 & ;映射
用于图像变形的投影映射作者:保罗·赫克伯特。
数学不是特别令人愉快,但也不是那么难。您还可以从上述链接之一找到一些代码。
This is a special case of finding mappings between quadrilaterals that preserve straight lines. These are generally called homographic transforms. Here, one of the quads is a rectangle, so this is a popular special case. You can google these terms ("quad to quad", etc) to find explanations and code, but here are some sites for you.
Perspective Transform Estimation
a gaming forum discussion
extracting a quadrilateral image to a rectangle
Projective Warping & Mapping
ProjectiveMappings for ImageWarping by Paul Heckbert.
The math isn't particularly pleasant, but it isn't that hard either. You can also find some code from one of the above links.
如果我理解正确的话,那么在矩形的投影中有一个 2D 点,并且您知道矩形所有四个角的 3D(世界)和 2D(图像)坐标。目标是找到投影到给定点的(3D,世界)矩形内部唯一点的 3D 坐标。
(对矩形的 3D(世界)坐标和 2D(图像)坐标执行下面的步骤 1-3。)
If I understand you correctly, you have a 2D point in the projection of the rectangle, and you know the 3D (world) and 2D (image) coordinates of all four corners of the rectangle. The goal is to find the 3D coordinates of the unique point on the interior of the (3D, world) rectangle which projects to the given point.
(Do steps 1-3 below for both the 3D (world) coordinates, and the 2D (image) coordinates of the rectangle.)