Search in sources :

Example 11 with Affine2D_F64

use of georegression.struct.affine.Affine2D_F64 in project BoofCV by lessthanoptimal.

the class TestStitchingFromMotion2D method checkInitialTransform.

/**
 * Checks to see if the user specified initial transformation is correctly applied
 */
@Test
public void checkInitialTransform() {
    HelperMotion motion = new HelperMotion();
    HelperDistort distort = new HelperDistort();
    StitchingTransform trans = FactoryStitchingTransform.createAffine_F64();
    StitchingFromMotion2D<GrayF32, Affine2D_F64> alg = new StitchingFromMotion2D<>(motion, distort, trans, 0.3);
    alg.configure(200, 300, motion0);
    assertTrue(alg.process(image));
    Affine2D_F64 expected = motion0.concat(translation, null);
    Affine2D_F64 found = alg.getWorldToCurr();
    assertEquals(expected.a11, found.a11, 1e-5);
    assertEquals(expected.tx, found.tx, 1e-5);
    assertEquals(expected.ty, found.ty, 1e-5);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) Affine2D_F64(georegression.struct.affine.Affine2D_F64) Test(org.junit.Test)

Example 12 with Affine2D_F64

use of georegression.struct.affine.Affine2D_F64 in project BoofCV by lessthanoptimal.

the class TestDetectCircleHexagonalGrid method process_easy.

@Test
public void process_easy() {
    Affine2D_F64 affine = new Affine2D_F64(1, 0, 0, 1, 100, 100);
    // performDetectionCheck(3, 4, 3, 4, affine); // too small for current algorithm
    // performDetectionCheck(4, 4, 4, 4, affine); // pathological case for current algorithm
    performDetectionCheck(5, 4, 5, 4, affine);
    performDetectionCheck(4, 5, 4, 5, affine);
    performDetectionCheck(5, 5, 5, 5, affine);
    performDetectionCheck(5, 6, 5, 6, affine);
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Test(org.junit.Test)

Example 13 with Affine2D_F64

use of georegression.struct.affine.Affine2D_F64 in project BoofCV by lessthanoptimal.

the class TestDetectCircleRegularGrid method process_negative.

@Test
public void process_negative() {
    Affine2D_F64 affine = new Affine2D_F64(1, 0, 0, 1, 100, 100);
    performDetectionCheck(4, 6, 5, 6, affine);
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Test(org.junit.Test)

Example 14 with Affine2D_F64

use of georegression.struct.affine.Affine2D_F64 in project BoofCV by lessthanoptimal.

the class TestEllipseClustersIntoHexagonalGrid method process_affine.

/**
 * Apply some affine distortion so that the grid isn't perfect
 */
@Test
public void process_affine() {
    // scale different amounts along each axis and translate for fun
    Affine2D_F64 affine0 = new Affine2D_F64(1.05, 0, 0, 0.95, 1, 2);
    // rotate a bit
    Affine2D_F64 affine1 = ConvertTransform_F64.convert(new Se2_F64(0, 0, 0.5), (Affine2D_F64) null);
    // process_affine( 3,3,affine0);
    process_affine(4, 3, affine0);
    process_affine(4, 4, affine0);
    process_affine(4, 5, affine0);
    process_affine(5, 5, affine0);
    // process_affine( 3,3,affine1);
    process_affine(4, 3, affine1);
    process_affine(4, 4, affine1);
    process_affine(4, 5, affine1);
    process_affine(5, 5, affine1);
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Se2_F64(georegression.struct.se.Se2_F64) Test(org.junit.Test)

Example 15 with Affine2D_F64

use of georegression.struct.affine.Affine2D_F64 in project BoofCV by lessthanoptimal.

the class TestSnapToLineEdge method fit_noisy_affine.

/**
 * Fit the quad with a noisy initial guess
 */
@Test
public void fit_noisy_affine() {
    // distorted and undistorted views
    Affine2D_F64[] affines = new Affine2D_F64[2];
    affines[0] = new Affine2D_F64();
    affines[1] = new Affine2D_F64(1.3, 0.05, -0.15, 0.87, 0.1, 0.6);
    ConvertTransform_F64.convert(new Se2_F64(0, 0, 0.2), affines[0]);
    for (Class imageType : imageTypes) {
        for (Affine2D_F64 a : affines) {
            fit_noisy_affine(a, imageType);
        }
    }
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Se2_F64(georegression.struct.se.Se2_F64) Test(org.junit.Test)

Aggregations

Affine2D_F64 (georegression.struct.affine.Affine2D_F64)24 Test (org.junit.Test)20 Se2_F64 (georegression.struct.se.Se2_F64)6 GrayF32 (boofcv.struct.image.GrayF32)4 Homography2D_F64 (georegression.struct.homography.Homography2D_F64)3 Rectangle2D_I32 (georegression.struct.shapes.Rectangle2D_I32)3 PixelTransformAffine_F32 (boofcv.alg.distort.PixelTransformAffine_F32)2 PixelTransform2_F32 (boofcv.struct.distort.PixelTransform2_F32)2 Affine2D_F32 (georegression.struct.affine.Affine2D_F32)2 RectangleLength2D_F64 (georegression.struct.shapes.RectangleLength2D_F64)2 WrapImageMotionPtkSmartRespawn (boofcv.abst.sfm.d2.WrapImageMotionPtkSmartRespawn)1 ImageDistort (boofcv.alg.distort.ImageDistort)1 PixelTransformHomography_F32 (boofcv.alg.distort.PixelTransformHomography_F32)1 InterpolatePixelS (boofcv.alg.interpolate.InterpolatePixelS)1 AssociatedPair (boofcv.struct.geo.AssociatedPair)1 ModelManagerAffine2D_F64 (georegression.fitting.affine.ModelManagerAffine2D_F64)1 ModelManagerHomography2D_F64 (georegression.fitting.homography.ModelManagerHomography2D_F64)1 ModelManagerSe2_F64 (georegression.fitting.se.ModelManagerSe2_F64)1 MotionSe2PointSVD_F64 (georegression.fitting.se.MotionSe2PointSVD_F64)1 Homography2D_F32 (georegression.struct.homography.Homography2D_F32)1