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