public static DMatrixRMaj inducedHomography13 ( TrifocalTensor tensor , Vector3D_F64 line2 , DMatrixRMaj output ) { if ( output == null ) output = new DMatrixRMaj ( 3 , 3 ) ; DMatrixRMaj T = tensor . T1 ; // H(:,0) = transpose(T1)*line output . data [ 0 ] = T . data [ 0 ] * line2 . x + T . data [ 3 ] * line2 . y + T . data [ 6 ] * line2 . z ; output . data [ 3 ] = T . data [ 1 ] * line2 . x + T . data [ 4 ] * line2 . y + T . data [ 7 ] * line2 . z ; output . data [ 6 ] = T . data [ 2 ] * line2 . x + T . data [ 5 ] * line2 . y + T . data [ 8 ] * line2 . z ; // H(:,1) = transpose(T2)*line T = tensor . T2 ; output . data [ 1 ] = T . data [ 0 ] * line2 . x + T . data [ 3 ] * line2 . y + T . data [ 6 ] * line2 . z ; output . data [ 4 ] = T . data [ 1 ] * line2 . x + T . data [ 4 ] * line2 . y + T . data [ 7 ] * line2 . z ; output . data [ 7 ] = T . data [ 2 ] * line2 . x + T . data [ 5 ] * line2 . y + T . data [ 8 ] * line2 . z ; // H(:,2) = transpose(T3)*line T = tensor . T3 ; output . data [ 2 ] = T . data [ 0 ] * line2 . x + T . data [ 3 ] * line2 . y + T . data [ 6 ] * line2 . z ; output . data [ 5 ] = T . data [ 1 ] * line2 . x + T . data [ 4 ] * line2 . y + T . data [ 7 ] * line2 . z ; output . data [ 8 ] = T . data [ 2 ] * line2 . x + T . data [ 5 ] * line2 . y + T . data [ 8 ] * line2 . z ; // Vector3D_F64 temp = new Vector3D_F64(); // // for( int i = 0; i < 3; i++ ) { // GeometryMath_F64.multTran(tensor.getT(i),line,temp); // output.unsafe_set(0,i,temp.x); // output.unsafe_set(1,i,temp.y); // output.unsafe_set(2,i,temp.z); // } return output ; }
Computes the homography induced from view 1 to 3 by a line in view 2 . The provided line in view 2 must contain the view 2 observation .