本文整理汇总了Java中org.ejml.ops.CommonOps.add方法的典型用法代码示例。如果您正苦于以下问题:Java CommonOps.add方法的具体用法?Java CommonOps.add怎么用?Java CommonOps.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.ops.CommonOps
的用法示例。
在下文中一共展示了CommonOps.add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: process
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* Computes the homography based on a line and point on the plane
* @param line Line on the plane
* @param point Point on the plane
*/
public void process(PairLineNorm line, AssociatedPair point) {
// t0 = (F*x) cross l'
GeometryMath_F64.mult(F,point.p1,Fx);
GeometryMath_F64.cross(Fx,line.getL2(),t0);
// t1 = x' cross ((f*x) cross l')
GeometryMath_F64.cross(point.p2, t0, t1);
// t0 = x' cross e'
GeometryMath_F64.cross(point.p2,e2,t0);
double top = GeometryMath_F64.dot(t0,t1);
double bottom = t0.normSq()*(line.l1.x*point.p1.x + line.l1.y*point.p1.y + line.l1.z);
// e' * l^T
GeometryMath_F64.outerProd(e2, line.l1, el);
// cross(l')*F
GeometryMath_F64.multCrossA(line.l2, F, lf);
CommonOps.add(lf,top/bottom,el,H);
// pick a good scale and sign for H
adjust.adjust(H, point);
}
示例3: constraint
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* <p>
* Trifocal tensor with point-line-point correspondence:<br>
* (l2<sup>T</sup>(sum p1<sup>i</sup>*T<sub>i</sub>)[p3]<sub>x</sub> = 0
* </p>
*
* @param tensor Trifocal tensor
* @param p1 A point in the first view.
* @param l2 A line in the second view.
* @param p3 A point in the third view.
* @return Result of applying the constraint. With perfect inputs will be zero.
*/
public static Vector3D_F64 constraint(TrifocalTensor tensor,
Point2D_F64 p1, Vector3D_F64 l2, Point2D_F64 p3,
Vector3D_F64 ret)
{
if( ret == null )
ret = new Vector3D_F64();
DenseMatrix64F sum = new DenseMatrix64F(3,3);
CommonOps.add(p1.x,tensor.T1,sum,sum);
CommonOps.add(p1.y,tensor.T2,sum,sum);
CommonOps.add(tensor.T3,sum,sum);
Vector3D_F64 tempV = new Vector3D_F64();
GeometryMath_F64.multTran(sum, l2, tempV);
GeometryMath_F64.cross(tempV, new Vector3D_F64(p3.x, p3.y, 1), ret);
return ret;
}
示例4: plus
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
public Matrix plus(double value) {
DenseMatrix64F ret = new DenseMatrix64F(matrix.numRows, matrix.numCols);
CommonOps.add(matrix, value, ret);
Matrix result = new EJMLDenseDoubleMatrix2D(ret);
MapMatrix<String, Object> a = getMetaData();
if (a != null) {
result.setMetaData(a.clone());
}
return result;
}
示例5: minus
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
public Matrix minus(double value) {
DenseMatrix64F ret = new DenseMatrix64F(matrix.numRows, matrix.numCols);
CommonOps.add(matrix, -value, ret);
Matrix result = new EJMLDenseDoubleMatrix2D(ret);
MapMatrix<String, Object> a = getMetaData();
if (a != null) {
result.setMetaData(a.clone());
}
return result;
}
示例6: 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;
}
示例7: 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;
}
示例8: canonicalCamera
import org.ejml.ops.CommonOps; //导入方法依赖的package包/类
/**
* <p>
* Given a fundamental matrix a pair of projection matrices [R|T] can be extracted. There are multiple
* solutions which can be found, the canonical projection matrix is defined as: <br>
* <pre>
* P=[I|0] and P'= [M|-M*t] = [[e']*F + e'*v^t | lambda*e']
* </pre>
* where e' is the epipole F<sup>T</sup>e' = 0, [e'] is the cross product matrix for the enclosed vector,
* v is an arbitrary 3-vector and lambda is a non-zero scalar.
* </p>
*
* <p>
* Page 256 in R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
* </p>
*
* @see #extractEpipoles
*
* @param F A fundamental matrix
* @param v Arbitrary 3-vector. Just pick some value, say (1,1,1).
* @param lambda A non zero scalar. Try one.
* @param e2 Left epipole of fundamental matrix, F<sup>T</sup>*e2 = 0.
* @return The canonical camera matrix P'
*/
public static DenseMatrix64F canonicalCamera( DenseMatrix64F F , Point3D_F64 e2, Vector3D_F64 v , double lambda ) {
DenseMatrix64F crossMatrix = new DenseMatrix64F(3,3);
GeometryMath_F64.crossMatrix(e2, crossMatrix);
DenseMatrix64F outer = new DenseMatrix64F(3,3);
GeometryMath_F64.outerProd(e2,v,outer);
DenseMatrix64F KR = new DenseMatrix64F(3,3);
CommonOps.mult(crossMatrix, F, KR);
CommonOps.add(KR, outer, KR);
DenseMatrix64F P = new DenseMatrix64F(3,4);
CommonOps.insert(KR,P,0,0);
P.set(0,3,lambda*e2.x);
P.set(1,3,lambda*e2.y);
P.set(2,3,lambda*e2.z);
return P;
}