use of georegression.struct.point.Point3D_F32 in project BoofCV by lessthanoptimal.
the class TestEquirectangularTools_F32 method equiToNorm_reverseFV.
private void equiToNorm_reverseFV(EquirectangularTools_F32 tools, float x, float y) {
Point3D_F32 n = new Point3D_F32();
Point2D_F32 r = new Point2D_F32();
tools.equiToNormFV(x, y, n);
tools.normToEquiFV(n.x, n.y, n.z, r);
assertEquals(x, r.x, GrlConstants.TEST_F32);
assertEquals(y, r.y, GrlConstants.TEST_F32);
}
use of georegression.struct.point.Point3D_F32 in project BoofCV by lessthanoptimal.
the class TestEquirectangularTools_F32 method equiToNormFV.
@Test
public void equiToNormFV() {
EquirectangularTools_F32 tools = new EquirectangularTools_F32();
tools.configure(300, 250);
Point3D_F32 found = new Point3D_F32();
tools.equiToNormFV(300 / 2, 249 / 2.0f, found);
assertEquals(1.0f, found.x, GrlConstants.TEST_F32);
assertEquals(0.0f, found.y, GrlConstants.TEST_F32);
assertEquals(0.0f, found.z, GrlConstants.TEST_F32);
tools.equiToNormFV(0, 249 / 2.0f, found);
assertTrue(found.distance(new Point3D_F32(-1, 0, 0)) <= GrlConstants.TEST_F32);
tools.equiToNormFV(300, 249 / 2.0f, found);
assertTrue(found.distance(new Point3D_F32(-1, 0, 0)) <= GrlConstants.TEST_F32);
tools.equiToNormFV(300 / 4, 249 / 2.0f, found);
assertTrue(found.distance(new Point3D_F32(0, -1, 0)) <= GrlConstants.TEST_F32);
tools.equiToNormFV(3 * 300 / 4, 249 / 2.0f, found);
assertTrue(found.distance(new Point3D_F32(0, 1, 0)) <= GrlConstants.TEST_F32);
tools.equiToNormFV(300 / 2, 0, found);
assertTrue(found.distance(new Point3D_F32(0, 0, -1)) <= GrlConstants.TEST_F32);
tools.equiToNormFV(300 / 2, 249, found);
assertTrue(found.distance(new Point3D_F32(0, 0, 1)) <= GrlConstants.TEST_F32);
}
use of georegression.struct.point.Point3D_F32 in project BoofCV by lessthanoptimal.
the class GeneralLensDistortionWideFOVChecks method pixel_unit_pixel_F32.
@Test
public void pixel_unit_pixel_F32() {
LensDistortionWideFOV alg = create();
Point2Transform3_F32 undistort = alg.undistortPtoS_F32();
Point3Transform2_F32 distort = alg.distortStoP_F32();
Point3D_F32 middle = new Point3D_F32();
Point2D_F32 found = new Point2D_F32();
undistort.compute(240, 260, middle);
distort.compute(middle.x, middle.y, middle.z, found);
assertEquals(240, found.x, pixel_tol_F32);
assertEquals(260, found.y, pixel_tol_F32);
}
Aggregations