use of boofcv.struct.calib.CameraKannalaBrandt in project BoofCV by lessthanoptimal.
the class TestKannalaBrandtPtoS_F64 method simpleSanityCheck_SymmetricOnly.
/**
* Given spherical coordinates, compute pixel coordinates and see if we can invert them correctly.
*/
@Test
void simpleSanityCheck_SymmetricOnly() {
CameraKannalaBrandt model = new CameraKannalaBrandt().fsetK(500, 550, 0.0, 600, 650);
model.fsetSymmetric(1.0, 0.1);
var expected = new Point3D_F64(0.1, -0.05, 0.8);
var pixel = new Point2D_F64();
var found = new Point3D_F64();
new KannalaBrandtStoP_F64(model).compute(expected.x, expected.y, expected.z, pixel);
new KannalaBrandtPtoS_F64(model).compute(pixel.x, pixel.y, found);
// make sure both have them have a norm of 1
expected.divideIP(expected.norm());
found.divideIP(found.norm());
// This should be very accurate. The inaccurate part isn't being called
assertEquals(0.0, expected.distance(found), UtilEjml.TEST_F64);
}
Aggregations