3D Photography: Point Based Rigid Registration Homework due: Wed., Oct. 9, in class. The subject of this homework is point based rigid registration. Registration is the task of finding a transformation from one coordinate system to another so that all features that appear in both data sets are aligned with each other. In this homework, we limit ourselves to rigid transformations with input given as points. THis means we need to find 3 translational parameters and 3 rotational parameters. Problem Definition Given the coordinates of points measured in two cartesian coordinate systems, find the rigid transformation between the two systems. Once we have this transformation, we can transform points in on coordinate system to the other.

1 Three Point Registration

Given the coordinates of three points in two coordinate systems, let us call them “left” and “right”. The points are pr1, pr2, pr3. We find the transformation between coordinate systems with the following construction:

1. Choose one of the points to be the origin, let us say p1. 2. Construct the x axis:

p2 − p1 x = |p2 − p1|

3. Construct the y axis:

y = (p3 − p1) − [(p3 − p1) · x]x y y = |y|

4. Construct the z axis:

z = x × y

5. Build the matrices for both point sets:

Rl = [xl, yl, zl] Rr = [xr, yr, zr]

6. The rotation between the “right” coordinate system to the “left” is given by:

t R = RlRr

7. The between the “right” coordinate system to the “left” is given by:

t = pl1 − Rpr1

This assumes we have a “match” of the 3 points in each data set with the other. Further, it is an exact method - there can be no imprecision with respect to noisy data. Write a program in the language of your choice to take 3 matching points in each of 2 coordinate systems, and compute the transformation. Verify your work by transforming the points from right to left and left to right, verifying the transformation.

1 2 Direct Method to Compute R and T

If we have a nosy point set, we can still calculate the transform using a direct method. Given 2 point sets (and you need to have at least 6 points) we can find the rotation and translation in the following way:

1. Find the centroid of each data set, and translate each data set to the origin. We can think of these data sets as the normalized data sets. 2. Once the data sets are both centered at the origin, we need to find the rotation about the origin that will brign them into registration. We compute the covariance matrix of the two normalized data sets. This matrix has as its eigenvector the rotation axis which maps the two point sets into each other. By using a Singular Value Decomposition (SVD) of the matrix, you can directly form the . 3. To get the “left” data set into registration with the “right” data set, we simply subtract the left centroid from each left point, rotate it by the , and then add in the right centroid to bring the left point into the right point.

So, create the covariance matrix of the normalized data sets below and you are done. You can find software to take the SVD in many places, including the book “Numerical Recipes”. We will provide you with a C code Numerical Recipes library if you need it. You will be given 2 data sets of x, y, z triples and you will compute the transformation between the data sets using this method. The data sets can be found at www.cs.columbia.edu/∼allen/F02/Homework.html.

• Method due to K. Arun, et. al., IEEE PAMI, Vol 9, no 5, pp 698-700, Sept 1987

– Step 1: Compute:

ai,xbi,x ai,xbi,y ai,xbi,z H =  a b a b a b  X i,y i,x i,y i,y i,y i,z i  ai,zbi,x ai,zbi,y ai,zbi,z 

– Step 2: Compute the Singular Value Decomposition (SVD) of H = USV t – Step 3: R = V U t – Step 4: Verify Det(R) = 1. If not, then algorithm may fail.

• Failure is rare, and mostly fixable. The paper has details.

2