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