public static DMatrixRMaj inducedHomography12 ( TrifocalTensor tensor , Vector3D_F64 line3 , DMatrixRMaj output ) { if ( output == null ) output = new DMatrixRMaj ( 3 , 3 ) ; // H(:,0) = T1*line DMatrixRMaj T = tensor . T1 ; output . data [ 0 ] = T . data [ 0 ] * line3 . x + T . data [ 1 ] * line3 . y + T . data [ 2 ] * line3 . z ; output . data [ 3 ] = T . data [ 3 ] * line3 . x + T . data [ 4 ] * line3 . y + T . data [ 5 ] * line3 . z ; output . data [ 6 ] = T . data [ 6 ] * line3 . x + T . data [ 7 ] * line3 . y + T . data [ 8 ] * line3 . z ; // H(:,0) = T2*line T = tensor . T2 ; output . data [ 1 ] = T . data [ 0 ] * line3 . x + T . data [ 1 ] * line3 . y + T . data [ 2 ] * line3 . z ; output . data [ 4 ] = T . data [ 3 ] * line3 . x + T . data [ 4 ] * line3 . y + T . data [ 5 ] * line3 . z ; output . data [ 7 ] = T . data [ 6 ] * line3 . x + T . data [ 7 ] * line3 . y + T . data [ 8 ] * line3 . z ; // H(:,0) = T3*line T = tensor . T3 ; output . data [ 2 ] = T . data [ 0 ] * line3 . x + T . data [ 1 ] * line3 . y + T . data [ 2 ] * line3 . z ; output . data [ 5 ] = T . data [ 3 ] * line3 . x + T . data [ 4 ] * line3 . y + T . data [ 5 ] * line3 . z ; output . data [ 8 ] = T . data [ 6 ] * line3 . x + T . data [ 7 ] * line3 . y + T . data [ 8 ] * line3 . z ; // Vector3D_F64 temp = new Vector3D_F64(); // // for( int i = 0; i < 3; i++ ) { // GeometryMath_F64.mult(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 2 by a line in view 3 . The provided line in view 3 must contain the view 3 observation .