Monday, September 21, 2009

How to build or calibrate a real rotation Matrix

In the previous article, I have introduced a POSIT algorithm to realize the Markers-Points correspondence problem, and after the application of POSIT algorithm we are able to achieve the rotation matrix and translation vector, which are used to reconstruct the 3D position of target. But from the reconstruction image we can find easily that the shape of reconstructed target is different with the original target. That implies only one thing: the achieved "rotation matrix" is not a proper rotation matrix which should be an orthogonal matrix and the determinant should be 1.

So it's very significant to modify the obtained matrix
C into a rotation-matrix standard form. That is to say, we should make it orthogonal. The train of thought is to achieve the maximal trace value of R'c, where R is the real rotation matrix and c is the obtained matrix. The proof is here, with

and that equals to the following relationship:


because w is a diagonal matrix, the solution to make it maximal is c' is a identity matrix, that is:

so we can get the real rotation matrix after SVD operation as follows:

and here is a example: the achieved matrix is

R =

-0.9006 -0.3442 -0.2656
-0.3469 0.1693 0.9225
-0.2725 0.9229 -0.2718

and the determinant of this matrix is 0.9999, let's do a SVD of this matrix, we can get
[U S V]=svd(R)

U =

-0.7071 -0.0000 -0.7071
-0.7071 0.0000 0.7071
0.0000 1.0000 -0.0000


S =

1.0045 0 0
0 1.0000 0
0 0 0.9955


V =

0.8781 -0.2725 0.3933
0.1231 0.9230 0.3647
-0.4624 -0.2718 0.8440

with the U matrix and V matrix multiplication, we are able to get the real rotation matrix with determinant 1 as:
Rnew = U*V'

Rnew =

-0.8990 -0.3449 -0.2698
-0.3428 0.1709 0.9237
-0.2725 0.9229 -0.2719

1 comments:

Kyliewyley said...

how do these 9 values translate into pitch, roll and yaw?