Search in sources :

Example 16 with Point3D_F32

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);
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) Point2D_F32(georegression.struct.point.Point2D_F32)

Example 17 with Point3D_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);
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) Test(org.junit.Test)

Example 18 with Point3D_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);
}
Also used : Point3D_F32(georegression.struct.point.Point3D_F32) Point2D_F32(georegression.struct.point.Point2D_F32) Point2Transform3_F32(boofcv.struct.distort.Point2Transform3_F32) Point3Transform2_F32(boofcv.struct.distort.Point3Transform2_F32) Test(org.junit.Test)

Aggregations

Point3D_F32 (georegression.struct.point.Point3D_F32)18 Point2D_F32 (georegression.struct.point.Point2D_F32)10 Point2Transform3_F32 (boofcv.struct.distort.Point2Transform3_F32)4 Test (org.junit.Test)4 Point3Transform2_F32 (boofcv.struct.distort.Point3Transform2_F32)3 PixelTransformCached_F32 (boofcv.alg.distort.PixelTransformCached_F32)2 PointToPixelTransform_F32 (boofcv.alg.distort.PointToPixelTransform_F32)2 CameraUniversalOmni (boofcv.struct.calib.CameraUniversalOmni)2 GrayF32 (boofcv.struct.image.GrayF32)2 UtilVector3D_F32 (georegression.geometry.UtilVector3D_F32)2 Vector3D_F32 (georegression.struct.point.Vector3D_F32)2 PinholePtoN_F32 (boofcv.alg.distort.pinhole.PinholePtoN_F32)1 LensDistortionRadialTangential (boofcv.alg.distort.radtan.LensDistortionRadialTangential)1 PixelTransform2_F32 (boofcv.struct.distort.PixelTransform2_F32)1 Point2Transform2_F32 (boofcv.struct.distort.Point2Transform2_F32)1 Rodrigues_F32 (georegression.struct.so.Rodrigues_F32)1 ArrayList (java.util.ArrayList)1 FMatrixRMaj (org.ejml.data.FMatrixRMaj)1