Search in sources :

Example 11 with TupleDesc_B

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;
}
Also used : ConfigGeneralDetector(boofcv.abst.feature.detect.interest.ConfigGeneralDetector) AssociateDescTo2D(boofcv.abst.feature.associate.AssociateDescTo2D) ScoreAssociateHamming_B(boofcv.abst.feature.associate.ScoreAssociateHamming_B) TupleDesc_B(boofcv.struct.feature.TupleDesc_B) GrayF32(boofcv.struct.image.GrayF32) Random(java.util.Random) DetectDescribeFusion(boofcv.abst.feature.detdesc.DetectDescribeFusion)

Example 12 with TupleDesc_B

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;
}
Also used : ConfigGeneralDetector(boofcv.abst.feature.detect.interest.ConfigGeneralDetector) AssociateMaxDistanceNaive(boofcv.alg.feature.associate.AssociateMaxDistanceNaive) ScoreAssociateHamming_B(boofcv.abst.feature.associate.ScoreAssociateHamming_B) WrapDescribeBrief(boofcv.abst.feature.describe.WrapDescribeBrief) TupleDesc_B(boofcv.struct.feature.TupleDesc_B) GrayF32(boofcv.struct.image.GrayF32) Random(java.util.Random) EasyGeneralFeatureDetector(boofcv.alg.feature.detect.interest.EasyGeneralFeatureDetector)

Example 13 with TupleDesc_B

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;
}
Also used : TupleDesc_B(boofcv.struct.feature.TupleDesc_B) GrayF32(boofcv.struct.image.GrayF32) Random(java.util.Random) ConfigGeneralDetector(boofcv.abst.feature.detect.interest.ConfigGeneralDetector) ScoreAssociateHamming_B(boofcv.abst.feature.associate.ScoreAssociateHamming_B)

Example 14 with TupleDesc_B

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);
    }
}
Also used : TupleDesc_B(boofcv.struct.feature.TupleDesc_B) Random(java.util.Random) Point2D_I32(georegression.struct.point.Point2D_I32)

Example 15 with TupleDesc_B

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);
}
Also used : TupleDesc_B(boofcv.struct.feature.TupleDesc_B) GrayF32(boofcv.struct.image.GrayF32) Test(org.junit.jupiter.api.Test)

Aggregations

TupleDesc_B (boofcv.struct.feature.TupleDesc_B)24 Test (org.junit.jupiter.api.Test)14 GrayF32 (boofcv.struct.image.GrayF32)11 Random (java.util.Random)6 ScoreAssociateHamming_B (boofcv.abst.feature.associate.ScoreAssociateHamming_B)4 ConfigGeneralDetector (boofcv.abst.feature.detect.interest.ConfigGeneralDetector)4 Point2D_I32 (georegression.struct.point.Point2D_I32)4 AssociateDescTo2D (boofcv.abst.feature.associate.AssociateDescTo2D)2 WrapDescribeBrief (boofcv.abst.feature.describe.WrapDescribeBrief)2 EasyGeneralFeatureDetector (boofcv.alg.feature.detect.interest.EasyGeneralFeatureDetector)2 DogArray_I32 (org.ddogleg.struct.DogArray_I32)2 DetectDescribeFusion (boofcv.abst.feature.detdesc.DetectDescribeFusion)1 AssociateMaxDistanceNaive (boofcv.alg.feature.associate.AssociateMaxDistanceNaive)1 FactoryGImageGray (boofcv.core.image.FactoryGImageGray)1 GImageGray (boofcv.core.image.GImageGray)1 ArrayList (java.util.ArrayList)1 ListAccessor (org.ddogleg.clustering.misc.ListAccessor)1 DogArray (org.ddogleg.struct.DogArray)1