Search in sources :

Example 1 with Point3Transform2_F64

use of boofcv.struct.distort.Point3Transform2_F64 in project BoofCV by lessthanoptimal.

the class GeneralLensDistortionWideFOVChecks method pixel_unit_pixel_F64.

@Test
public void pixel_unit_pixel_F64() {
    LensDistortionWideFOV alg = create();
    Point2Transform3_F64 undistort = alg.undistortPtoS_F64();
    Point3Transform2_F64 distort = alg.distortStoP_F64();
    Point3D_F64 middle = new Point3D_F64();
    Point2D_F64 found = new Point2D_F64();
    undistort.compute(240, 260, middle);
    distort.compute(middle.x, middle.y, middle.z, found);
    assertEquals(240, found.x, pixel_tol_F64);
    assertEquals(260, found.y, pixel_tol_F64);
}
Also used : Point3D_F64(georegression.struct.point.Point3D_F64) Point2D_F64(georegression.struct.point.Point2D_F64) Point2Transform3_F64(boofcv.struct.distort.Point2Transform3_F64) Point3Transform2_F64(boofcv.struct.distort.Point3Transform2_F64) Test(org.junit.Test)

Example 2 with Point3Transform2_F64

use of boofcv.struct.distort.Point3Transform2_F64 in project BoofCV by lessthanoptimal.

the class GeneralLensDistortionWideFOVChecks method blowup_extreme_angle_F64.

/**
 * Give it spherical coordinate pointing slightly behind.  See if it blows up when converting into pixels
 */
@Test
public void blowup_extreme_angle_F64() {
    LensDistortionWideFOV alg = create();
    Point3Transform2_F64 distort = alg.distortStoP_F64();
    Point2D_F64 found = new Point2D_F64();
    double x = 1.0;
    double z = -0.001;
    double r = Math.sqrt(x * x + z * z);
    distort.compute(x / r, 0, z / x, found);
    assertTrue(!UtilEjml.isUncountable(found.x));
    assertTrue(!UtilEjml.isUncountable(found.y));
}
Also used : Point2D_F64(georegression.struct.point.Point2D_F64) Point3Transform2_F64(boofcv.struct.distort.Point3Transform2_F64) Test(org.junit.Test)

Aggregations

Point3Transform2_F64 (boofcv.struct.distort.Point3Transform2_F64)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 Test (org.junit.Test)2 Point2Transform3_F64 (boofcv.struct.distort.Point2Transform3_F64)1 Point3D_F64 (georegression.struct.point.Point3D_F64)1