Search in sources :

Example 66 with TupleDesc_F64

use of boofcv.struct.feature.TupleDesc_F64 in project BoofCV by lessthanoptimal.

the class TestAssociateStereo2D method constraintY.

/**
 * Makes sure observations have the same y-axis
 */
@Test
public void constraintY() {
    // zap the rotation so that no adjustment should need to be done
    Point3D_F64 X = new Point3D_F64(0.02, -0.5, 3);
    SfmTestHelper.renderPointPixel(param, X, leftP, rightP);
    // mangle the y-axis
    leftP.y += 0.25;
    pointsLeft.grow().set(leftP);
    pointsRight.grow().set(rightP);
    descLeft.grow();
    descRight.grow();
    AssociateStereo2D<TupleDesc_F64> alg = new AssociateStereo2D<>(scorer, 0.5, TupleDesc_F64.class);
    alg.setCalibration(param);
    alg.setSource(pointsLeft, descLeft);
    alg.setDestination(pointsRight, descRight);
    alg.associate();
    // at the current tolerance they should still match
    assertEquals(1, alg.getMatches().size);
    // make the tolerance tighter
    alg = new AssociateStereo2D<>(scorer, 0.01, TupleDesc_F64.class);
    alg.setCalibration(param);
    alg.setSource(pointsLeft, descLeft);
    alg.setDestination(pointsRight, descRight);
    alg.associate();
    assertEquals(0, alg.getMatches().size);
}
Also used : Point3D_F64(georegression.struct.point.Point3D_F64) TupleDesc_F64(boofcv.struct.feature.TupleDesc_F64) Test(org.junit.Test)

Aggregations

TupleDesc_F64 (boofcv.struct.feature.TupleDesc_F64)66 Test (org.junit.Test)47 GrayF32 (boofcv.struct.image.GrayF32)17 GrayU8 (boofcv.struct.image.GrayU8)8 Point2D_I32 (georegression.struct.point.Point2D_I32)6 TupleDesc_S8 (boofcv.struct.feature.TupleDesc_S8)5 ArrayList (java.util.ArrayList)5 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)4 BufferedImage (java.awt.image.BufferedImage)4 File (java.io.File)4 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)3 DetectDescribePoint (boofcv.abst.feature.detdesc.DetectDescribePoint)3 TupleDesc_U8 (boofcv.struct.feature.TupleDesc_U8)3 Planar (boofcv.struct.image.Planar)3 Point3D_F64 (georegression.struct.point.Point3D_F64)3 HistogramScene (boofcv.alg.scene.HistogramScene)2 AssociatedIndex (boofcv.struct.feature.AssociatedIndex)2 ImageGray (boofcv.struct.image.ImageGray)2 IOException (java.io.IOException)2 FastQueue (org.ddogleg.struct.FastQueue)2