Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

camera translation vector - relation to rotation matrix

I am working with some code which outputs a 3x3 rotation matrix and a translation vector representing a cameras orientation and location.

However, the documentation states that to get the location of the camera one must multiply the transposed and inverted rotation matrix by the translation vector. Does that mean that the original vector is not the location of the camera? If not, what does that original vector represent?

like image 212
freakTheMighty Avatar asked Mar 08 '10 18:03

freakTheMighty


People also ask

How do you combine translation and rotation?

A rotation matrix and a translation matrix can be combined into a single matrix as follows, where the r's in the upper-left 3-by-3 matrix form a rotation and p, q and r form a translation vector. This matrix represents rotations followed by a translation.

Does rotation commute with translation?

Rotations and translations do not commute. Translations and scales do not commute. Scales and rotations commute only in the special case when scaling by the same amount in all directions. In general the two operations do not commute.

How do you translate and rotate a coordinate system?

Coordinate systems can also be translated and rotated in space: In a translation, the origin is simply shifted in the x, y and z directions. The associated (x,y,z) number is called translation vector. In a rotation, the coordinate system is rotated around the x, y and z axes.

How do you translate using a vector?

Translation Vector GuideThe top number of the vector tells you if you are moving the shape left or right. If the number is negative, you move the shape left. If the number is positive, you move the shape right. The bottom number of the vector tells you if you are moving the down or up.


1 Answers

I'm assuming that the R (rotation matrix) and t (the translation vector) you obtained were w.r.t a world coordinate system with (0,0,0) as the origin.

With R and t you can now move a point from the world coordinate system (WC) to the camera coordinate system (CC), i.e. Xc = RX + t where X is a 3D point in WC and Xc is X in CC (i.e. seen from the camera's point of view). This is applicable assuming we're dealing with rigid bodies so we just rotate the point and then translate it.

Now, you need to find the coordinates of the camera center which is the origin of CC, or when Xc = 0:

0 = RC + t where C is the 3D coordinates of the camera center in WC. By solving for C we get,

C = -R-1t

And by the way,

A correction in your documentation

Transposing and multiplying the rotation matrix does not change the rotation matrix --- a rotation matrix is orthogonal which means it's transpose is equal to its inverse and therefore, (RT)-1 = R.

like image 126
Jacob Avatar answered Oct 16 '22 12:10

Jacob