use of boofcv.abst.feature.describe.DescribePointRadiusAngle 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.DescribePointRadiusAngle in project BoofCV by lessthanoptimal.
the class ExampleDetectDescribe method createFromComponents.
/**
* Any arbitrary implementation of InterestPointDetector, OrientationImage, DescribeRegionPoint
* can be combined into DetectDescribePoint. The syntax is more complex, but the end result is more flexible.
* This should only be done if there isn't a pre-made DetectDescribePoint.
*/
public static <T extends ImageGray<T>, TD extends TupleDesc<TD>> DetectDescribePoint<T, TD> createFromComponents(Class<T> imageType) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(1000, 5, 1), null, derivType);
InterestPointDetector detector = FactoryInterestPoint.wrapPoint(corner, 1, imageType, derivType);
// describe points using BRIEF
DescribePointRadiusAngle describe = FactoryDescribePointRadiusAngle.brief(new ConfigBrief(true), imageType);
// NOTE: orientation will not be estimated
return FactoryDetectDescribe.fuseTogether(detector, null, describe);
}
use of boofcv.abst.feature.describe.DescribePointRadiusAngle in project BoofCV by lessthanoptimal.
the class TestDetectDescribeFusion method checkFeatureNotInBounds.
/**
* If a feature is not in bounds make sure everything is handled correctly
*/
@Test
void checkFeatureNotInBounds() {
InterestPointDetector detector = new DummyDetector();
DescribePointRadiusAngle describe = new DummyRegionPoint();
DetectDescribeFusion alg = new DetectDescribeFusion(detector, null, describe);
alg.detect(new GrayF32(2, 2));
// one feature should not be inside the image
assertEquals(9, alg.getNumberOfFeatures());
for (int i = 0; i < 9; i++) {
assertEquals(2, alg.getRadius(i), 1e-8);
assertEquals(1, alg.getOrientation(i), 1e-8);
assertTrue(alg.getDescription(i) != null);
assertTrue(alg.getLocation(i) != null);
}
}
use of boofcv.abst.feature.describe.DescribePointRadiusAngle in project BoofCV by lessthanoptimal.
the class TestDescribePlanar method various.
@Test
void various() {
DescribePointRadiusAngle[] descs = new DummyDesc[3];
descs[0] = new DummyDesc();
descs[1] = new DummyDesc();
descs[2] = new DummyDesc();
DummyAlg alg = new DummyAlg(descs);
alg.setImage(new Planar(GrayS8.class, 1, 1, 3));
alg.process(0, 1, 2, 3, alg.createDescription());
assertEquals(30, alg.createDescription().size());
assertEquals(1, alg.numCombined);
for (int i = 0; i < 3; i++) {
assertEquals(1, ((DummyDesc) descs[i]).numProcess);
}
}
Aggregations