Search in sources :

Example 6 with Affine2D_F64

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

the class TestDetectCircleRegularGrid method process_rotated.

@Test
public void process_rotated() {
    double c = Math.cos(0.4);
    double s = Math.sin(0.4);
    Affine2D_F64 affine = new Affine2D_F64(c, -s, s, c, 140, 100);
    performDetectionCheck(5, 6, 5, 6, affine);
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Test(org.junit.Test)

Example 7 with Affine2D_F64

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

the class TestDetectCircleRegularGrid method process_easy.

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

Example 8 with Affine2D_F64

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

the class TestKeyPointsCircleRegularGrid method all.

@Test
public void all() {
    all(new Affine2D_F64());
    for (int i = 1; i < 10; i++) {
        // System.out.println("i = "+i);
        double yaw = 2.0 * Math.PI * i / 10.0;
        Affine2D_F64 rot = ConvertTransform_F64.convert(new Se2_F64(0, 0, yaw), (Affine2D_F64) null);
        all(rot);
    }
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Se2_F64(georegression.struct.se.Se2_F64) Test(org.junit.Test)

Example 9 with Affine2D_F64

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

the class TestRefinePolygonToGrayLine method fit_perfect_transform.

/**
 * Perfect initial guess. But provide a transform which will undo the affine transform
 */
@Test
public void fit_perfect_transform() {
    // distorted and undistorted views
    Affine2D_F64[] affines = new Affine2D_F64[1];
    affines[0] = new Affine2D_F64(0.8, 0, 0, 0.8, 0, 0);
    rectangles.add(new Rectangle2D_I32(x0, y0, x1, y1));
    for (Class imageType : imageTypes) {
        for (Affine2D_F64 a : affines) {
            // System.out.println(imageType+"  "+a);
            fit_perfect_transform(true, a, imageType);
            fit_perfect_transform(false, a, imageType);
        }
    }
}
Also used : Affine2D_F64(georegression.struct.affine.Affine2D_F64) Rectangle2D_I32(georegression.struct.shapes.Rectangle2D_I32) Test(org.junit.Test)

Example 10 with Affine2D_F64

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

the class TestStitchingFromMotion2D method resizeStitchImage_noTransform.

@Test
public void resizeStitchImage_noTransform() {
    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, null);
    assertTrue(alg.process(image));
    ImageMiscOps.fill(alg.getStitchedImage().subimage(2, 3, 30, 40, null), 1);
    alg.resizeStitchImage(250, 400, null);
    // see if the image is where it should be
    checkBlock(2, 3, 30, 40, alg.getStitchedImage());
    // check the stiched image size
    assertEquals(250, alg.getStitchedImage().width);
    assertEquals(400, alg.getStitchedImage().height);
    // no transform provided, should be the same
    Affine2D_F64 found = alg.getWorldToCurr();
    assertEquals(1, found.tx, 1e-5);
    assertEquals(-2, found.ty, 1e-5);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) Affine2D_F64(georegression.struct.affine.Affine2D_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