Question

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

alt text

2D layout diagram of space

alt text

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.

Was it helpful?

Solution

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 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 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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top