1 Absolute Orientation Determination using Horn Approach.

15
1 Absolute Orientation Determination using Horn Approach

Transcript of 1 Absolute Orientation Determination using Horn Approach.

Page 1: 1 Absolute Orientation Determination using Horn Approach.

1

Absolute Orientation Determination using Horn

Approach

Page 2: 1 Absolute Orientation Determination using Horn Approach.

2

Hidden Tiger

Team Members

John, Zhang

Feng Lu

Li Liu

Ali Ahmad

Page 3: 1 Absolute Orientation Determination using Horn Approach.

3

Design Issues: 

The “Software for Absolute Orientation Determination using the Horn Approach” project is a highly technical implementation of rigorous mathematics calculations, these functions include:

       Centroid Finder        Input Transformation with respect to centroids        Eigen values and Eigen vectors        Output manipulator

Page 4: 1 Absolute Orientation Determination using Horn Approach.

4

Detailed Design Information:

The horn approach aims to find the unit quaternion that represents the best rotation between 2 coordinate systems, this is achieved by applying a closed form mathematical model on a set of point measured in the 2 coordinate systems. This can be illustrated in the figure below.

HornRot(Main Module)

Input

Output

Page 5: 1 Absolute Orientation Determination using Horn Approach.

5

Detailed Design Information:

the figure, input and output refers to the user end, the user in our case, can be either a human or another piece of code.

In the input section, the user inputs a set of N points (i.e. triples of x,y,z) measured in both the left and right hand coordinate systems. The points will be inputted as a set of floats, and based on the client request, they will be represented as a continues stream of values. That is x1,y1,z1, x2,y2,z2, and so on for both coordinate systems.

The output represents the result returned to the user, i.e. the unit quaternion, which is a set of four floats, whose sum of squares is equal to one.

Page 6: 1 Absolute Orientation Determination using Horn Approach.

6

Horn Approach for finding rotation

Input: n-points (triples) in both the left and right coordinate systems (rl , rr)   Procedure: 

1. Get the centroids for both sets of points

  , same applies to right

2. Transform the points as measurements with respect to  

centroids, , same applies to right

  Result: A set of n-points (triples) in each coordinate system measured with

respect to their respective centroids.

n

iill r

nr

1,

1

lilil rrr ,,

Page 7: 1 Absolute Orientation Determination using Horn Approach.

7

Horn Approach for finding rotation

3. Define the matrix N:

  where,

in this formula, prime denotes transformed coordinates.  4. Find and sort the Eigen values of N

det (N - I) = 0, and solve for . m is the maximum positive Eigen value. 5. The quaternion that represents the best rotation is the Eigen vector that

corresponds to the largest positive Eigen Value. And is obtained by solving the homogeneous equation:

[ N - mI ]. em = 0

)(

)(

)(

)(

zzyyxxzyyzxzzxyxxy

zyyzzzyyxxyxxyxzzx

xzzxyxxyzzyyxxzyyz

yxxyxzzxzyyzzzyyxx

SSSSSSSSS

SSSSSSSSS

SSSSSSSSS

SSSSSSSSS

N

n

iirilxy

n

iirilxx yxSxxS

1

',

',

1

',

', ,

Page 8: 1 Absolute Orientation Determination using Horn Approach.

8

DESIGN DETAIL

I. Input manipulator: Puts the user input in an accessible format, most likely 2 dimensional arrays of point vectors.

The user input is received as a set of floats, and the input manipulator parses through this set of floats and puts them into 2 matrices, one for each coordinate system. Example: lets assume the following user input: {1,2,3,2,2,3,2,2,4, 2,3,4,2,5,4,2,4,4}. This set of 3 points can be represented in the following 2 matrices, in this format, the points are the columns, and the ; represent row separators.

L=[1,2,3;2,2,3;2,2,4] R=[2,3,4;2,5,4;2,4,4]

Page 9: 1 Absolute Orientation Determination using Horn Approach.

9

DESIGN DETAIL

II.   Centroid Finder: Finds the centroids for the left and the right data sets.

The centroid can be defined simply as the vector that represents mathematical average of the coordinates of a set of points. For our example the centroids are:

LC = [2.0000, 2.3333, 2.6667]’

RC = [3.0000, 3.6667, 3.3333] ‘

Page 10: 1 Absolute Orientation Determination using Horn Approach.

10

DESIGN DETAIL

III. Transformer: Transforms the points with respect to centroids. This is achieved by simply by taking the difference between various point vectors and centroids, a way for doing so utilizing matrices is

for i=1:3 for j=1:N LL(i,j)=L(i,j)-LC(i); RR(i,j)=R(i,j)-LC(i); end end The results in our example are:

LL = RR= -1.0000 0 1.0000 0 1.0000 2.0000 -0.3333 -0.3333 0.6667 -0.3333 2.6667 1.6667 -0.6667 -0.6667 1.3333 -0.6667 1.3333 1.3333

Page 11: 1 Absolute Orientation Determination using Horn Approach.

11

DESIGN DETAIL

IV.   Sum Function: Calculates the various sums, The matrix is a matrix of dot products of transformed elements in the 2 coordinate systems, where i, j refer to the right and the left coordinate systems respectively.

In our example, the matrix M will be:

M = 2.0000 2.0000 2.0000

1.0000 0.3333 0.6667 2.0000 0.6667 1.3333

for i=1:3

for j=1:3

S=0;

for k=1:N

S=S+LL(i,k)*RR(j,k);

end

M(i,j)=S;

end

end

Page 12: 1 Absolute Orientation Determination using Horn Approach.

12

DESIGN DETAIL

V.  MtoN Converter: Calculates the matrix N from the various matrix M elements. Utilizes the various M elements (sums) , that will come up with the 4 by 4 matrix that will be used to determine the rotation.

In our example: N = 3.6667 -0.0000 0.0000 1.0000 -0.0000 0.3333 3.0000 4.0000 0.0000 3.0000 -3.0000 1.3333 1.0000 4.0000 1.3333 -1.0000

)(

)(

)(

)(

zzyyxxzyyzxzzxyxxy

zyyzzzyyxxyxxyxzzx

xzzxyxxyzzyyxxzyyz

yxxyxzzxzyyzzzyyxx

SSSSSSSSS

SSSSSSSSS

SSSSSSSSS

SSSSSSSSS

N

Page 13: 1 Absolute Orientation Determination using Horn Approach.

13

DESIGN DETAIL

VI.   EigenValue solver: Finds the Eigen values of the matrix N. This code is currently being researched for reuse purposes, there are various implementations, but, we need to find accurate and fast one.

VII.   EigenValue sorter: Sorts the Eigen values of the matrix N

A typical sort function that sorts the Eigen values for our matrix N, as required by the algorithm “the largest positive Eigen value ”

VIII.   EigenVector Finder: Finds the Eigen vector that corresponds to the largest positive Eigen value, this is the required quaternion. Mathematical implementation, related to VI, as most implementations usually calculate both Eigen values and Eigen vectors hand in hand.

 

Page 14: 1 Absolute Orientation Determination using Horn Approach.

14

DESIGN DETAIL

IX.  OutputFunction: Returns the Eigen Vector (the Unit Quaternion) as a set of floats the quaternion of best rotation, the result in our example is:

RotationUnitQuaternion = 0.3640 0.6654 0.3343 0.5595

 X.   Validation and Exception handling: User Input Validation: The number of inputted floats is matching to

construct 2 sets of points for the number of points given. Guarding against incorrect user input.

Eigen value checker: upon sorting the Eigen values, is the largest positive? Accuracy of implementation vs. MATLAB results.

Page 15: 1 Absolute Orientation Determination using Horn Approach.

15

Thank you!

Questions ???