use of boofcv.struct.feature.TupleDesc_B in project BoofCV by lessthanoptimal.
the class TestDdaManagerDetectDescribePoint method createTracker.
@Override
public PointTracker<GrayF32> createTracker() {
DescribePointBrief<GrayF32> brief = FactoryDescribePointAlgs.brief(FactoryBriefDefinition.gaussian2(new Random(123), 16, 512), FactoryBlurFilter.gaussian(ImageType.single(GrayF32.class), 0, 4));
GeneralFeatureDetector<GrayF32, GrayF32> corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(100, 2, 0, 0, true), false, GrayF32.class);
InterestPointDetector<GrayF32> detector = FactoryInterestPoint.wrapPoint(corner, 1, GrayF32.class, GrayF32.class);
ScoreAssociateHamming_B score = new ScoreAssociateHamming_B();
AssociateDescription2D<TupleDesc_B> association = new AssociateDescTo2D<>(FactoryAssociation.greedy(score, 400, true));
DetectDescribeFusion<GrayF32, TupleDesc_B> fused = new DetectDescribeFusion<>(detector, null, new WrapDescribeBrief<>(brief, GrayF32.class));
DdaManagerDetectDescribePoint<GrayF32, TupleDesc_B> manager;
manager = new DdaManagerDetectDescribePoint<>(fused);
DetectDescribeAssociate<GrayF32, TupleDesc_B> tracker = new DetectDescribeAssociate<>(manager, association, false);
return tracker;
}
use of boofcv.struct.feature.TupleDesc_B in project BoofCV by lessthanoptimal.
the class TestDetectDescribeAssociateTwoPass method createTracker.
@Override
public PointTrackerTwoPass<GrayF32> createTracker() {
DescribePointBrief<GrayF32> brief = FactoryDescribePointAlgs.brief(FactoryBriefDefinition.gaussian2(new Random(123), 16, 512), FactoryBlurFilter.gaussian(ImageType.single(GrayF32.class), 0, 4));
GeneralFeatureDetector<GrayF32, GrayF32> corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(-1, 2, 0), false, GrayF32.class);
ScoreAssociateHamming_B score = new ScoreAssociateHamming_B();
// use an association algorithm which uses the track's pose information
AssociateDescription2D<TupleDesc_B> association = new AssociateMaxDistanceNaive<>(score, true, 400, 20);
DescribeRegionPoint<GrayF32, TupleDesc_B> describe = new WrapDescribeBrief<>(brief, GrayF32.class);
EasyGeneralFeatureDetector<GrayF32, GrayF32> easy = new EasyGeneralFeatureDetector<>(corner, GrayF32.class, GrayF32.class);
DdaManagerGeneralPoint<GrayF32, GrayF32, TupleDesc_B> manager;
manager = new DdaManagerGeneralPoint<>(easy, describe, 2);
DetectDescribeAssociateTwoPass<GrayF32, TupleDesc_B> tracker = new DetectDescribeAssociateTwoPass<>(manager, association, association, false);
return tracker;
}
use of boofcv.struct.feature.TupleDesc_B in project BoofCV by lessthanoptimal.
the class TestPointTrackerCombined method createTracker.
@Override
public PointTracker<GrayF32> createTracker() {
DescribePointBrief<GrayF32> brief = FactoryDescribePointAlgs.brief(FactoryBriefDefinition.gaussian2(new Random(123), 16, 512), FactoryBlurFilter.gaussian(ImageType.single(GrayF32.class), 0, 4));
GeneralFeatureDetector<GrayF32, GrayF32> corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(100, 2, 0), false, GrayF32.class);
InterestPointDetector<GrayF32> detector = FactoryInterestPoint.wrapPoint(corner, 1, GrayF32.class, GrayF32.class);
ScoreAssociateHamming_B score = new ScoreAssociateHamming_B();
AssociateDescription<TupleDesc_B> association = FactoryAssociation.greedy(score, 400, true);
PointTracker<GrayF32> pointTracker = FactoryPointTracker.combined(detector, null, new WrapDescribeBrief<>(brief, GrayF32.class), association, null, 20, GrayF32.class);
return pointTracker;
}
use of boofcv.struct.feature.TupleDesc_B in project BoofCV by lessthanoptimal.
the class BenchmarkDescribe method BriefSO512.
@Benchmark
public void BriefSO512() {
int briefRadius = 16;
DescribePointBriefSO<I> alg = FactoryDescribeAlgs.briefso(FactoryBriefDefinition.gaussian2(new Random(123), briefRadius, 512), FactoryBlurFilter.gaussian(imageType, 0, 4));
alg.setImage(gray);
TupleDesc_B f = alg.createFeature();
for (int i = 0; i < pts.length; i++) {
Point2D_I32 p = pts[i];
alg.process(p.x, p.y, (float) yaws[i], (float) (briefRadius * scales[i]), f);
}
}
use of boofcv.struct.feature.TupleDesc_B in project BoofCV by lessthanoptimal.
the class TestDescribePointBriefSO method testIntensityInvariance.
/**
* Vary the intensity of the input image and see if the description changes.
*/
@Test
void testIntensityInvariance() {
GrayF32 input = createImage(width, height);
GrayF32 mod = input.clone();
GPixelMath.multiply(input, 2, mod);
DescribePointBriefSO<GrayF32> alg = createAlg();
TupleDesc_B desc1 = alg.createFeature();
TupleDesc_B desc2 = alg.createFeature();
// compute the image from the same image but different intensities
alg.setImage(input);
alg.process(input.width / 2, input.height / 2, 0, briefRadius, desc1);
alg.setImage(mod);
alg.process(input.width / 2, input.height / 2, 0, briefRadius, desc2);
// compare the descriptions
int count = 0;
for (int i = 0; i < desc1.numBits; i++) {
count += desc1.isBitTrue(i) == desc2.isBitTrue(i) ? 1 : 0;
}
// blurring the image can cause some bits to switch in the description
assertTrue(count > desc1.numBits - 3);
}
Aggregations