I have a camera and a table and I want to align the camera to co-exist in the same coordinate system as the table. Here is an image of the setting.

What type of mathematical transformations I need to apply?

Here is what I think I need to apply: 1. Translation to the Z-axis. 2. Rotation to the Y-axis with a negative angle. 3. Rotation to the X-axis with a positive angle.

Do I need to rotate the Z-axis as well? The camera sees points on the table and I want to rotate my points around the Y-axis only. However, is this even correct if my coordinate systems are not aligned for all axis.

Sorry if it is not very clear. English is not my first language.


The problem is similar to transformation of the virtual world onto the rectangular screen of the virtual camera of 3D computer graphics, see e.g. here.

The transformations here are affine 3D transformations, which can be expressed nicely as $4 \times 4$ matrices using homogeneous coordinates.

So I would suggest to pick up some good book on 3D computer graphics, e.g. Foley-Van Dam.

  • $\begingroup$ Thanks a lot. I am confused about the x-axis, do you think that I need to rotate it so that the table co-exists with the camera? $\endgroup$ – Sekaie May 2 '16 at 5:13
  • $\begingroup$ I assume your goal is to relate table coordinates $(x,y,z)$ with coordinates $(sx, sy)$ on the screen / image which is recorded by your camera. This kind of transformation is explained in many books on 3D graphics, like the one mentioned by me. $\endgroup$ – mvw May 2 '16 at 9:18
  • $\begingroup$ I have looked into some references but as you mentioned they handle 3D-2D transformation. I want 3D-3D transformation. Is there a difference in the way I should approach the problem? I tried to solve the system of equations but I got wrong values and I don't know if that's because of the values in the fourth row. I put the values in the 4th row as [0,0,0,1]. $\endgroup$ – Sekaie May 2 '16 at 16:45
  • $\begingroup$ No, the transformations should just lead to vectors of the form $(x,y,z,1)$. Possible errors are picking the wrong transformation or wrong order of application of the individual transformations. The advantage is that the translations can be expressed as matrices as well, and you will need a translation if your origins differ. $\endgroup$ – mvw May 2 '16 at 16:58
  • $\begingroup$ I have 6 points on the table and their corresponding points as seen by the camera. Can I get the transformation matrix correctly without knowing the explicit transformations? $\endgroup$ – Sekaie May 2 '16 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.