/** * Computes the null space of the linear system to find the trifocal tensor */ protected boolean solveLinearSystem() { if( !svdNull.decompose(A) ) return false; SingularOps.nullVector(svdNull,true,vectorizedSolution); solutionN.convertFrom(vectorizedSolution); return true; }
/** * Computes the null space of A and extracts the transform. */ private void computeTransform( DenseMatrix64F A ) { if( !svd.decompose(A) ) throw new RuntimeException("SVD failed?"); SingularOps.nullVector(svd,true,x); DenseMatrix64F R = motion.getR(); Vector3D_F64 T = motion.getT(); // extract the results System.arraycopy(x.data,0,R.data,0,9); T.x = x.data[9]; T.y = x.data[10]; T.z = x.data[11]; }
/** * Computes the SVD of A and extracts the homography matrix from its null space */ protected boolean computeH(DenseMatrix64F A, DenseMatrix64F H) { if( !svd.decompose(A) ) return true; if( A.numRows > 8 ) SingularOps.nullVector(svd,true,H); else { // handle a special case since the matrix only has 8 singular values and won't select // the correct column DenseMatrix64F V = svd.getV(null,false); SpecializedOps.subvector(V, 0, 8, V.numCols, false, 0, H); } return false; }
SpecializedOps.subvector(V, 0, 4, V.numRows, false, 0, b); } else { SingularOps.nullVector(svd,true,b); if( !svd.decompose(A) ) throw new RuntimeException("SVD failed"); SingularOps.nullVector(svd,true,b); computeParam();
/** * Computes the SVD of A and extracts the essential/fundamental matrix from its null space */ protected boolean process(DenseMatrix64F A, DenseMatrix64F F ) { if( !svdNull.decompose(A) ) return true; if( A.numRows > 8 ) SingularOps.nullVector(svdNull,true,F); else { // handle a special case since the matrix only has 8 singular values and won't select // the correct column DenseMatrix64F V = svdNull.getV(null,false); SpecializedOps.subvector(V, 0, 8, V.numCols, false, 0, F); } return false; } }
throw new RuntimeException("SVD failed!?!?"); SingularOps.nullVector(svd,true,v);
SingularOps.nullVector(svd, true, v1); SingularOps.nullVector(svd, false,u1); SingularOps.nullVector(svd,true,v2); SingularOps.nullVector(svd,false,u2); SingularOps.nullVector(svd,true,v3); SingularOps.nullVector(svd,false,u3); SingularOps.nullVector(svd, false, tempE); e2.set(tempE.get(0), tempE.get(1), tempE.get(2)); SingularOps.nullVector(svd, false, tempE); e3.set(tempE.get(0), tempE.get(1), tempE.get(2));
throw new RuntimeException("SVD failed!?!?"); SingularOps.nullVector(svd,true,v);
SingularOps.nullVector(svdV,true,xp);