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);
}
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);
}
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);
}
}
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);
}
}
}
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);
}
Aggregations