Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine transformation matrix

As a followup to my previous question about determining camera parameters I have formulated a new problem.

I have two pictures of the same rectangle:

The first is an image without any transformations and shows the rectangle as it is.

The second image shows the rectangle after some 3d transformation (XYZ-rotation, scaling, XY-translation) is applied. This has caused the rectangle to look a trapezoid.

I hope the following picture describes my problem:

alt text http://wilco.menge.nl/application.data/cms/upload/transformation%20matrix.png

How do determine what transformations (more specifically: what transformation matrix) have caused this tranformation?

I know the pixel locations of the corners in both images, hence i also know the distances between the corners.

like image 759
dwergkees Avatar asked Jul 13 '09 19:07

dwergkees


2 Answers

I'm confused. Is this a 2d or a 3d problem?

The way I understand it, you have a flat rectangle embedded in 3d space, and you're looking at two 2d "pictures" of it - one of the original version and one based on the transformed version. Is this correct?

If this is correct, then there is not enough information to solve the problem. For example, suppose the two pictures look exactly the same. This could be because the translation is the identity, or it could be because the translation moves the rectangle twice as far away from the camera and doubles its size (thus making it look exactly the same).

like image 134
Alex319 Avatar answered Sep 24 '22 16:09

Alex319


This is a math problem, not programming ..

you need to define a set of equations (your transformation matrix, my guess is 3 equations) and then solve it for the 4 transformations of the corner-points.

I've only ever described this using German words ... so the above will sound strange ..

like image 23
lexu Avatar answered Sep 24 '22 16:09

lexu