use of georegression.struct.se.Se3_F32 in project BoofCV by lessthanoptimal.
the class TestMultiCameraToEquirectangular method all.
@Test
public void all() {
MultiCameraToEquirectangular<GrayF32> alg = createAlgorithm();
alg.addCamera(new Se3_F32(), new HelperDistortion(), inputWidth, inputHeight);
Se3_F32 cam2_to_1 = new Se3_F32();
ConvertRotation3D_F32.eulerToMatrix(EulerType.XYZ, GrlConstants.F_PI, 0, 0, cam2_to_1.R);
alg.addCamera(cam2_to_1, new HelperDistortion(), inputWidth, inputHeight);
GrayF32 image0 = new GrayF32(inputWidth, inputHeight);
GrayF32 image1 = new GrayF32(inputWidth, inputHeight);
ImageMiscOps.fill(image0, 200);
ImageMiscOps.fill(image1, 100);
List<GrayF32> images = new ArrayList<>();
images.add(image0);
images.add(image1);
alg.render(images);
GrayF32 found = alg.getRenderedImage();
double totalError = 0;
for (int y = 0; y < equiHeight; y++) {
for (int x = 0; x < equiWidth; x++) {
if (y < equiHeight / 2) {
totalError += Math.abs(200 - found.get(x, y));
} else {
totalError += Math.abs(100 - found.get(x, y));
}
}
}
double errorFraction = totalError / (equiWidth * equiHeight * 100);
assertTrue(errorFraction < 0.05);
}
Aggregations