如何将由 4 个点标识的任意平面投影到二维平面上? [英] How can I project an arbitrary plane identified by 4 points onto a 2d plane?

查看:22
本文介绍了如何将由 4 个点标识的任意平面投影到二维平面上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们试图解决在平面的两种不同表示中定位点的问题.我们拥有的第一个平面被旋转以创建透视图;第二个是同一平面的二维视图.我们对每个我们知道等效的计划都有 4 分.问题是如果我们在平面 1 中有一个任意点,我们如何找到平面 2 中的对应点?

最好对用例进行说明,以便最好地阐明问题.我们在左边有一张图片.

游戏论坛讨论

将四边形图像提取为矩形

图像变形的投影映射作者:保罗·赫克伯特.

数学不是特别令人愉快,但也不是那么难.您还可以从上述链接之一中找到一些代码.

更新

这是我的最爱之一:计算投影变换

The issue we are trying to solve the issue of locating a point in two different representations of a plane. The first plane we have is rotated to create perspective; the second is a 2d view of that same plane. We have 4 points on each of the plans that we know to be equivalent. The question is if we have an arbitrary point in plane 1, how do we find the corresponding point in plane 2?

It is best probably to illustrate the use case in order to best clarify the question. We have an image illustrated on the left.

Projective plane

2D layout diagram of space

So the givens that we have are the red squares from both pictures. Note that if possible, I’d like it to be possible that the 2D space isn’t necessarily a square. These are available to us ahead of time and known. I also have green dots laid out on the plane in the first image. I’d like to be able to do a projection of the dot in image 1 onto the space in image 2.

Note also for the image 1 I do not have a defined window or eye position. I just know that the red square from image 1 is a transform of the red square form image 2 and that the image 2 is in 2D space.

解决方案

This is a special case of finding mappings between quadrilaterals that preserve straight lines. These are generally called homographic or projective transforms. Here, one of the quads is a square, 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 for you.

Perspective Transform Estimation

a gaming forum discussion

extracting a quadrilateral image to a rectangle

Projective Mappings for Image Warping 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.

Update

And this is one of my favorites: Computing a projective transformation

这篇关于如何将由 4 个点标识的任意平面投影到二维平面上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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