use of boofcv.struct.geo.AssociatedPair in project BoofCV by lessthanoptimal.
the class RectifyFundamental method computeAffineH.
/**
* Finds the values of a,b,c which minimize
*
* sum (a*x(+)_i + b*y(+)_i + c - x(-)_i)^2
*
* See page 306
*
* @return Affine transform
*/
private SimpleMatrix computeAffineH(List<AssociatedPair> observations, DMatrixRMaj H, DMatrixRMaj Hzero) {
SimpleMatrix A = new SimpleMatrix(observations.size(), 3);
SimpleMatrix b = new SimpleMatrix(A.numRows(), 1);
Point2D_F64 c = new Point2D_F64();
Point2D_F64 k = new Point2D_F64();
for (int i = 0; i < observations.size(); i++) {
AssociatedPair a = observations.get(i);
GeometryMath_F64.mult(Hzero, a.p1, k);
GeometryMath_F64.mult(H, a.p2, c);
A.setRow(i, 0, k.x, k.y, 1);
b.set(i, 0, c.x);
}
SimpleMatrix x = A.solve(b);
SimpleMatrix Ha = SimpleMatrix.identity(3);
Ha.setRow(0, 0, x.getDDRM().data);
return Ha;
}
use of boofcv.struct.geo.AssociatedPair in project BoofCV by lessthanoptimal.
the class DistanceAffine2D method computeDistance.
@Override
public void computeDistance(List<AssociatedPair> points, double[] distance) {
for (int i = 0; i < points.size(); i++) {
AssociatedPair p = points.get(i);
AffinePointOps_F64.transform(model, p.p1, expected);
distance[i] = expected.distance(p.p2);
}
}
use of boofcv.struct.geo.AssociatedPair in project BoofCV by lessthanoptimal.
the class DistanceAffine2DSq method computeDistance.
@Override
public void computeDistance(List<AssociatedPair> points, double[] distance) {
for (int i = 0; i < points.size(); i++) {
AssociatedPair p = points.get(i);
AffinePointOps_F64.transform(model, p.p1, expected);
distance[i] = expected.distance2(p.p2);
}
}
use of boofcv.struct.geo.AssociatedPair in project BoofCV by lessthanoptimal.
the class DistanceHomographyPixelSq method computeDistance.
@Override
public void computeDistance(List<AssociatedPair> points, double[] distance) {
for (int i = 0; i < points.size(); i++) {
AssociatedPair p = points.get(i);
HomographyPointOps_F64.transform(model, p.p1, expected);
distance[i] = errorCam2.errorSq(expected, p.p2);
}
}
use of boofcv.struct.geo.AssociatedPair in project BoofCV by lessthanoptimal.
the class DistanceSe3SymmetricSq method computeDistance.
@Override
public void computeDistance(List<AssociatedPair> associatedPairs, double[] distance) {
for (int i = 0; i < associatedPairs.size(); i++) {
AssociatedPair obs = associatedPairs.get(i);
distance[i] = computeDistance(obs);
}
}
Aggregations