Computing an objects transformation matrix from intersecting pixel coordinates

Started by
16 comments, last by dave_s_lyne 15 years, 4 months ago
Can anyone help me solve this problem? I have three known world-space xyz points located on a plane. All three of these points are visible to the camera. The cameras frustum is known and the locations in the cameras pixel space of each of the three points of the plane are also known. From this information is it possible to calculate the transformation matrix of the plane? I can only think of an iterative method that doesn't seem very robust. Thanks in advance!
Advertisement
I think I understand what you're trying to accomplish... However, do you have the view and projection matrices for the camera?
Yes I do. I have the frustum of the camera and I know the view port.

Also, just to clarify I'm assuming that the camera is placed at the origin with no rotation applied to it.
In that case, what do you mean by the transformation matrix? The only transformation happening that I can consider is the projection of the plane onto screen coordinates. Do you actually know the full screen coordinates or just the x and y components of it (i.e. the 2D pixel coordinates)?
Quote:Original post by Fingon
In that case, what do you mean by the transformation matrix? The only transformation happening that I can consider is the projection of the plane onto screen coordinates. Do you actually know the full screen coordinates or just the x and y components of it (i.e. the 2D pixel coordinates)?



Just the x and y. Not the depth. Otherwise it would be very easy!

The transformation is the matrix defining the translation/rotation of the plane from the origin. I only know the local coordinates of the plane. The plane is not at the origin.
Ah, that clarifies matters greatly for me. Indeed, I thought you had only the x and y coordinates, though I didn't want to treat this situation as more complicated than it might have been.

Intuition tells me that given the information you specified, an analytic solution ought to be possible (thought it may involve some tricky maths). Sorry for all the questions... last one is: do you know the scale relationship between the global and local world spaces (or are they identical)? Anyway I'll give everything some serious thought in the morning and let you know what I come up with then.
Quote:Original post by Fingon
Ah, that clarifies matters greatly for me. Indeed, I thought you had only the x and y coordinates, though I didn't want to treat this situation as more complicated than it might have been.

Intuition tells me that given the information you specified, an analytic solution ought to be possible (thought it may involve some tricky maths). Sorry for all the questions... last one is: do you know the scale relationship between the global and local world spaces (or are they identical)? Anyway I'll give everything some serious thought in the morning and let you know what I come up with then.


They are identical. I know what you mean when you say an analytical method is possible as I've been thinking exactly the same thing but have been unable to come up with a solution!

Thanks so much for your efforts!
Why don't you know the depth?
Quote:Original post by RDragon1
Why don't you know the depth?


My software is using real imagery to generate the 3d representation.
Uhh. Given a point p in 3d space and the camera, then

p' = M * p, where M is the camera projection matrix and p' is the point in camera space.

You want p given p'.

As long as M is invertible, which it should be, I think the answer is just
p = M^(-1)p'

Once you have the 3 points in space, you can find the plane containing them.

This topic is closed to new replies.

Advertisement