# program3 - has R’(1)=(1,0,0 R’(1 framenum)=(0,1,0 The...

This preview shows pages 1–3. Sign up to view the full content.

Program-3 Tomasi-kanade SFM Algorithm Implement Tomasi-kanade Algorithm I For hotel sequence, two matrix U,V are given in the class website. They record the 2D coordinates of 106 feature points in 180 frames. = V U W Calculate ~ W based on W . Calculate ^ W by rank constraint on ~ W . Calculate ^ R and ^ S by SVD decomposition of ^ W . Calculate the Q matrix by Newton’s method. Here is a snapshot of our slides In which the error is calculated by ) ( current i q f . The initial Q is identity matrix. Threshold is 0.01 for ' . q q . The maximum iteration time is set to 100 Then add the Matlab code below to your program to plot your result of S from a fixed direction for everyone: figure;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
x = S(1,: ); y = S(2,: ); z = S(3,: ); hold on; for i = 1: Count plot3(x(i ),y( i ),z( i ),'.','lineWidth',1); end hold off; axis vis3d; view([-8,-14]); xlabel('X'); ylabel('Y'); zlabel('Z'); z For the plotting of yaw, roll, pitch: Each row of R needs to be rotated by a 3x3 matrix r. The result R’ should
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: has R’(1,:)=(1,0,0), R’(1+framenum,:)=(0,1,0). The rotation matrix r can be build by vector i , j , and the cross product of i and j in the first frame. Since the rotation matrix R i of a frame i can be presented by three angles or three axis i , j , k as = -= ) 3 ( ) 3 ( ) 3 ( ) 2 ( ) 2 ( ) 2 ( ) 1 ( ) 1 ( ) 1 ( ... sin cos sin ... ... cos sin ... ... ... k j i k j i k j i R i γ β α Therefore ) ) cos( ) 3 ( arcsin( ) ) cos( ) 2 ( arcsin( )) 3 ( arcsin( j i i = =-= Then they need to be converted from radian to degree since the ground truth is in degree. The final results need to be plotted together with the ground truth. This figure is a demo of one plot of the three angles....
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

program3 - has R’(1)=(1,0,0 R’(1 framenum)=(0,1,0 The...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online