use of boofcv.struct.sfm.ScaleTranslateRotate2D in project BoofCV by lessthanoptimal.
the class TestDistanceScaleTranslateRotate2DSq method multiple.
@Test
public void multiple() {
ScaleTranslateRotate2D model = new ScaleTranslateRotate2D(0.2, 1.5, -2, 3);
AssociatedPair a = apply(-5, 4, model);
a.p2.x += 3.5;
AssociatedPair b = apply(2.15, 2, model);
List<AssociatedPair> obs = new ArrayList<>();
obs.add(a);
obs.add(b);
DistanceScaleTranslateRotate2DSq alg = new DistanceScaleTranslateRotate2DSq();
alg.setModel(model);
double[] found = new double[2];
alg.computeDistance(obs, found);
assertEquals(3.5 * 3.5, found[0], 1e-8);
assertEquals(0, found[1], 1e-8);
}
Aggregations