use of boofcv.abst.geo.TriangulateNViewsProjective in project BoofCV by lessthanoptimal.
the class TestCompatibleProjectiveHomography method createScene.
@Override
public void createScene(int numFeatures, boolean planar) {
super.createScene(numFeatures, planar);
// Triangulate 3D points in another projective
TrifocalTensor T = MultiViewOps.createTrifocal(cameras.get(0), cameras.get(1), cameras.get(2), null);
DMatrixRMaj P1 = new DMatrixRMaj(3, 4);
DMatrixRMaj P2 = new DMatrixRMaj(3, 4);
DMatrixRMaj P3 = new DMatrixRMaj(3, 4);
MultiViewOps.trifocalToCameraMatrices(T, P2, P3);
CommonOps_DDRM.setIdentity(P1);
TriangulateNViewsProjective triangulator = FactoryMultiView.triangulateNViewProj(ConfigTriangulation.GEOMETRIC());
List<Point2D_F64> observations = new ArrayList<>();
for (int i = 0; i < 3; i++) {
observations.add(new Point2D_F64());
}
camerasB = new ArrayList<>();
camerasB.add(P1);
camerasB.add(P2);
camerasB.add(P3);
sceneB = new ArrayList<>();
for (int i = 0; i < numFeatures; i++) {
AssociatedTriple t = triples.get(i);
observations.get(0).setTo(t.p1);
observations.get(1).setTo(t.p2);
observations.get(2).setTo(t.p3);
Point4D_F64 location = new Point4D_F64();
assertTrue(triangulator.triangulate(observations, camerasB, location));
sceneB.add(location);
}
}
Aggregations