Search in sources :

Example 1 with DescribePointRadiusAngleConvertTuple

use of boofcv.abst.feature.describe.DescribePointRadiusAngleConvertTuple in project BoofCV by lessthanoptimal.

the class CompareConvertedDescriptionsApp method main.

public static void main(String[] args) {
    String file1 = UtilIO.pathExample("stitch/kayak_01.jpg");
    String file2 = UtilIO.pathExample("stitch/kayak_02.jpg");
    InterestPointDetector<GrayF32> detector = FactoryInterestPoint.fastHessian(new ConfigFastHessian(1, 10, -1, 2, 9, 4, 4), GrayF32.class);
    DescribePointRadiusAngle<GrayF32, TupleDesc_F64> describeA = (DescribePointRadiusAngle) FactoryDescribePointRadiusAngle.surfStable(null, GrayF32.class);
    ConvertTupleDesc<TupleDesc_F64, TupleDesc_S8> converter = FactoryConvertTupleDesc.real_F64_S8(describeA.createDescription().size());
    DescribePointRadiusAngle<GrayF32, TupleDesc_S8> describeB = new DescribePointRadiusAngleConvertTuple<>(describeA, converter);
    ScoreAssociation<TupleDesc_F64> scoreA = FactoryAssociation.scoreSad(TupleDesc_F64.class);
    ScoreAssociation<TupleDesc_S8> scoreB = FactoryAssociation.scoreSad(TupleDesc_S8.class);
    BufferedImage image1 = Objects.requireNonNull(UtilImageIO.loadImage(file1));
    BufferedImage image2 = Objects.requireNonNull(UtilImageIO.loadImage(file2));
    visualize("Original", image1, image2, detector, describeA, scoreA);
    visualize("Modified", image1, image2, detector, describeB, scoreB);
    System.out.println("Done");
}
Also used : TupleDesc_S8(boofcv.struct.feature.TupleDesc_S8) ConfigFastHessian(boofcv.abst.feature.detect.interest.ConfigFastHessian) TupleDesc_F64(boofcv.struct.feature.TupleDesc_F64) DescribePointRadiusAngleConvertTuple(boofcv.abst.feature.describe.DescribePointRadiusAngleConvertTuple) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage) GrayF32(boofcv.struct.image.GrayF32) DescribePointRadiusAngle(boofcv.abst.feature.describe.DescribePointRadiusAngle) FactoryDescribePointRadiusAngle(boofcv.factory.feature.describe.FactoryDescribePointRadiusAngle)

Example 2 with DescribePointRadiusAngleConvertTuple

use of boofcv.abst.feature.describe.DescribePointRadiusAngleConvertTuple in project BoofCV by lessthanoptimal.

the class TestDescribeRegionPointConvert method basic.

@Test
public void basic() {
    DummyConvert convert = new DummyConvert();
    DummyDescribe original = new DummyDescribe();
    DescribePointRadiusAngleConvertTuple<GrayF32, TupleDesc_F64, TupleDesc_S8> alg = new DescribePointRadiusAngleConvertTuple<>(original, convert);
    TupleDesc_S8 found = alg.createDescription();
    assertEquals(found.data.length, 5);
    assertFalse(original.calledImageSet);
    alg.setImage(null);
    assertTrue(original.calledImageSet);
    alg.process(1, 2, 2, 2, found);
    assertEquals(5, found.data[0]);
    assertEquals(original.isOriented(), alg.isOriented());
    assertEquals(original.isScalable(), alg.isScalable());
    assertSame(alg.getDescriptionType(), TupleDesc_S8.class);
}
Also used : TupleDesc_S8(boofcv.struct.feature.TupleDesc_S8) GrayF32(boofcv.struct.image.GrayF32) TupleDesc_F64(boofcv.struct.feature.TupleDesc_F64) DescribePointRadiusAngleConvertTuple(boofcv.abst.feature.describe.DescribePointRadiusAngleConvertTuple) Test(org.junit.jupiter.api.Test)

Aggregations

DescribePointRadiusAngleConvertTuple (boofcv.abst.feature.describe.DescribePointRadiusAngleConvertTuple)2 TupleDesc_F64 (boofcv.struct.feature.TupleDesc_F64)2 TupleDesc_S8 (boofcv.struct.feature.TupleDesc_S8)2 GrayF32 (boofcv.struct.image.GrayF32)2 DescribePointRadiusAngle (boofcv.abst.feature.describe.DescribePointRadiusAngle)1 ConfigFastHessian (boofcv.abst.feature.detect.interest.ConfigFastHessian)1 FactoryDescribePointRadiusAngle (boofcv.factory.feature.describe.FactoryDescribePointRadiusAngle)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 BufferedImage (java.awt.image.BufferedImage)1 Test (org.junit.jupiter.api.Test)1