Search in sources :

Example 6 with ScaleTranslateRotate2D

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);
}
Also used : AssociatedPair(boofcv.struct.geo.AssociatedPair) ScaleTranslateRotate2D(boofcv.struct.sfm.ScaleTranslateRotate2D) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ScaleTranslateRotate2D (boofcv.struct.sfm.ScaleTranslateRotate2D)6 Test (org.junit.Test)5 AssociatedPair (boofcv.struct.geo.AssociatedPair)4 ArrayList (java.util.ArrayList)2 GenerateScaleTranslateRotate2D (boofcv.alg.sfm.robust.GenerateScaleTranslateRotate2D)1 ModelManagerScaleTranslateRotate2D (boofcv.alg.sfm.robust.ModelManagerScaleTranslateRotate2D)1