本文整理汇总了Java中org.ejml.ops.CommonOps.multTransA方法的典型用法代码示例。如果您正苦于以下问题:Java CommonOps.multTransA方法的具体用法?Java CommonOps.multTransA怎么用?Java CommonOps.multTransA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.ops.CommonOps
的用法示例。
在下文中一共展示了CommonOps.multTransA方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeDirection
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Compute the direction of optimization from the value vector and the Jacobean. This is where
* Gauss Newton really happens.
*/
private double[] computeDirection() {
DenseMatrix64F jacoMat = new DenseMatrix64F(jacobean);
// J^T J (nrOfCo x nrOfCo)
DenseMatrix64F jacoSquare = new DenseMatrix64F(nrOfVariables, nrOfVariables);
CommonOps.multInner(jacoMat, jacoSquare);
DenseMatrix64F fMat = new DenseMatrix64F(nrOfEquations, 1, true, values);
// J^T value (nrOfCo x 1)
DenseMatrix64F rhs = new DenseMatrix64F(nrOfVariables, 1);
CommonOps.multTransA(jacoMat, fMat, rhs);
// result = (J^TJ)^-1 J^T value (nrOfCo x 1)
// J^TJ result = J^T value
DenseMatrix64F result = new DenseMatrix64F(nrOfVariables, 1);
if (CommonOps.solve(jacoSquare, rhs, result)) {
return result.getData();
} else {
return null;
}
}
示例2: eigenToSampleSpace
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Converts a vector from eigen space into sample space.
*
* @param eigenData Eigen space data.
* @return Sample space projection.
*/
public double[] eigenToSampleSpace(double[] eigenData) {
if (eigenData.length != getNumPrincipalComponents()) {
throw new IllegalArgumentException("Unexpected sample length");
}
DenseMatrix64F s = new DenseMatrix64F(getDataMatrix().getNumCols(), 1);
DenseMatrix64F r = DenseMatrix64F.wrap(getNumPrincipalComponents(), 1, eigenData);
CommonOps.multTransA(getPrincipalComponentSubspace(), r, s);
DenseMatrix64F mean = DenseMatrix64F.wrap(getDataMatrix().getNumCols(), 1, this.getMean());
CommonOps.add(s, mean, s);
return s.data;
}
示例3: createFundamental
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Computes a Fundamental matrix given an Essential matrix and the camera calibration matrix.
*
* F = (K2<sup>-1</sup>)<sup>T</sup>*E*K1<sup>-1</sup>
*
* @param E Essential matrix
* @param K1 Intrinsic camera calibration matrix for camera 1
* @param K2 Intrinsic camera calibration matrix for camera 2
* @return Fundamental matrix
*/
public static DenseMatrix64F createFundamental(DenseMatrix64F E,
DenseMatrix64F K1, DenseMatrix64F K2) {
DenseMatrix64F K1_inv = new DenseMatrix64F(3,3);
CommonOps.invert(K1,K1_inv);
DenseMatrix64F K2_inv = new DenseMatrix64F(3,3);
CommonOps.invert(K2,K2_inv);
DenseMatrix64F F = new DenseMatrix64F(3,3);
DenseMatrix64F temp = new DenseMatrix64F(3,3);
CommonOps.multTransA(K2_inv,E,temp);
CommonOps.mult(temp,K1_inv,F);
return F;
}
示例4: eigenToSampleSpace
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Converts a vector from eigen space into sample space.
*
* @param eigenData Eigen space data.
* @return Sample space projection.
*/
public double[] eigenToSampleSpace( double[] eigenData ) {
if( eigenData.length != numComponents )
throw new IllegalArgumentException("Unexpected sample length");
DenseMatrix64F s = new DenseMatrix64F(A.getNumCols(),1);
DenseMatrix64F r = DenseMatrix64F.wrap(numComponents,1,eigenData);
CommonOps.multTransA(V_t,r,s);
DenseMatrix64F mean = DenseMatrix64F.wrap(A.getNumCols(),1,this.mean);
CommonOps.add(s,mean,s);
return s.data;
}
示例5: eigenToSampleSpace
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Converts a vector from eigen space into sample space.
*
* @param eigenData Eigen space data.
* @return Sample space projection.
*/
public double[] eigenToSampleSpace( double[] eigenData ) {
if( eigenData.length != numComponents )
throw new IllegalArgumentException("Unexpected sample length");
DenseMatrix64F s = new DenseMatrix64F(A.getNumCols(),1);
DenseMatrix64F r = DenseMatrix64F.wrap(numComponents,1,eigenData);
CommonOps.multTransA(V_t,r,s);
DenseMatrix64F mean = DenseMatrix64F.wrap(A.getNumCols(),1,this.mean);
CommonOps.add(s,mean,s);
return s.data;
}
示例6: computeResiduals
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
@Override
public int computeResiduals(AssociatedPair p, double[] residuals, int index) {
GeometryMath_F64.mult(H, p.p1, temp);
double top1 = error1(p.p1.x,p.p1.y,p.p2.x,p.p2.y);
double top2 = error2(p.p1.x, p.p1.y, p.p2.x, p.p2.y);
computeJacobian(p.p1,p.p2);
// JJ = J*J'
CommonOps.multTransB(J, J, JJ);
// solve JJ'*x = -e
e.data[0] = -top1;
e.data[1] = -top2;
if( solver.setA(JJ) ) {
solver.solve(e,x);
// -J'(J*J')^-1*e
CommonOps.multTransA(J,x,error);
residuals[index++] = error.data[0];
residuals[index++] = error.data[1];
residuals[index++] = error.data[2];
residuals[index++] = error.data[3];
} else {
residuals[index++] = 0;
residuals[index++] = 0;
residuals[index++] = 0;
residuals[index++] = 0;
}
return index;
}
示例7: decomposeEssential
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
@Test
public void decomposeEssential() {
DenseMatrix64F R = RotationMatrixGenerator.eulerXYZ(1,2,-0.5,null);
Vector3D_F64 T = new Vector3D_F64(0.5,0.7,-0.3);
DenseMatrix64F E = MultiViewOps.createEssential(R,T);
List<Se3_F64> found = MultiViewOps.decomposeEssential(E);
// the scale factor is lost
T.normalize();
int numMatched = 0;
for( Se3_F64 m : found ) {
DenseMatrix64F A = new DenseMatrix64F(3,3);
CommonOps.multTransA(R,m.getR(),A);
if( !MatrixFeatures.isIdentity(A,1e-8) ) {
continue;
}
Vector3D_F64 foundT = m.getT();
foundT.normalize();
if( foundT.isIdentical(T,1e-8) )
numMatched++;
}
assertEquals(1,numMatched);
}
示例8: undoNormalizationF
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Undo the normalization done to the input matrices for a Fundamental matrix.
* <br>
* M = N<sub>2</sub><sup>T</sup>*M*N<sub>1</sub>
*
* @param M Either the homography or fundamental matrix computed from normalized points.
* @param N1 normalization matrix.
* @param N2 normalization matrix.
*/
protected void undoNormalizationF(DenseMatrix64F M, DenseMatrix64F N1, DenseMatrix64F N2) {
// M = N2^T * M * N1
CommonOps.multTransA(N2,M,temp0);
CommonOps.mult(temp0,N1,M);
}