Search in sources :

Example 1 with ScoreAssociateHamming_B

use of boofcv.abst.feature.associate.ScoreAssociateHamming_B in project BoofCV by lessthanoptimal.

the class VisualizeStereoVisualOdometryApp method createStereoDepth.

private StereoVisualOdometry<I> createStereoDepth(int whichAlg) {
    Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
    StereoDisparitySparse<I> disparity = FactoryStereoDisparity.regionSparseWta(2, 150, 3, 3, 30, -1, true, imageType);
    PkltConfig kltConfig = new PkltConfig();
    kltConfig.templateRadius = 3;
    kltConfig.pyramidScaling = new int[] { 1, 2, 4, 8 };
    if (whichAlg == 0) {
        ConfigGeneralDetector configDetector = new ConfigGeneralDetector(600, 3, 1);
        PointTrackerTwoPass<I> tracker = FactoryPointTrackerTwoPass.klt(kltConfig, configDetector, imageType, derivType);
        return FactoryVisualOdometry.stereoDepth(1.5, 120, 2, 200, 50, false, disparity, tracker, imageType);
    } else if (whichAlg == 1) {
        ConfigGeneralDetector configExtract = new ConfigGeneralDetector(600, 3, 1);
        GeneralFeatureDetector detector = FactoryPointTracker.createShiTomasi(configExtract, derivType);
        DescribeRegionPoint describe = FactoryDescribeRegionPoint.brief(null, imageType);
        ScoreAssociateHamming_B score = new ScoreAssociateHamming_B();
        AssociateDescription2D<TupleDesc_B> associate = new AssociateDescTo2D<>(FactoryAssociation.greedy(score, 150, true));
        PointTrackerTwoPass tracker = FactoryPointTrackerTwoPass.dda(detector, describe, associate, null, 1, imageType);
        return FactoryVisualOdometry.stereoDepth(1.5, 80, 3, 200, 50, false, disparity, tracker, imageType);
    } else if (whichAlg == 2) {
        PointTracker<I> tracker = FactoryPointTracker.combined_ST_SURF_KLT(new ConfigGeneralDetector(600, 3, 0), kltConfig, 50, null, null, imageType, derivType);
        PointTrackerTwoPass<I> twopass = new PointTrackerToTwoPass<>(tracker);
        return FactoryVisualOdometry.stereoDepth(1.5, 80, 3, 200, 50, false, disparity, twopass, imageType);
    } else if (whichAlg == 3) {
        ConfigGeneralDetector configDetector = new ConfigGeneralDetector(600, 3, 1);
        PointTracker<I> trackerLeft = FactoryPointTracker.klt(kltConfig, configDetector, imageType, derivType);
        PointTracker<I> trackerRight = FactoryPointTracker.klt(kltConfig, configDetector, imageType, derivType);
        DescribeRegionPoint describe = FactoryDescribeRegionPoint.surfFast(null, imageType);
        return FactoryVisualOdometry.stereoDualTrackerPnP(90, 2, 1.5, 1.5, 200, 50, trackerLeft, trackerRight, describe, imageType);
    } else if (whichAlg == 4) {
        // GeneralFeatureIntensity intensity =
        // FactoryIntensityPoint.hessian(HessianBlobIntensity.Type.TRACE,defaultType);
        GeneralFeatureIntensity intensity = FactoryIntensityPoint.shiTomasi(1, false, imageType);
        NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(2, 50, 0, true, false, true));
        GeneralFeatureDetector general = new GeneralFeatureDetector(intensity, nonmax);
        general.setMaxFeatures(600);
        DetectorInterestPointMulti detector = new GeneralToInterestMulti(general, 2, imageType, derivType);
        // DescribeRegionPoint describe = FactoryDescribeRegionPoint.brief(new ConfigBrief(true),defaultType);
        // DescribeRegionPoint describe = FactoryDescribeRegionPoint.pixelNCC(5,5,defaultType);
        DescribeRegionPoint describe = FactoryDescribeRegionPoint.surfFast(null, imageType);
        DetectDescribeMulti detDescMulti = new DetectDescribeMultiFusion(detector, null, describe);
        return FactoryVisualOdometry.stereoQuadPnP(1.5, 0.5, 75, Double.MAX_VALUE, 300, 50, detDescMulti, imageType);
    } else {
        throw new RuntimeException("Unknown selection");
    }
}
Also used : NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GeneralToInterestMulti(boofcv.abst.feature.detect.interest.GeneralToInterestMulti) PkltConfig(boofcv.alg.tracker.klt.PkltConfig) FactoryDescribeRegionPoint(boofcv.factory.feature.describe.FactoryDescribeRegionPoint) DescribeRegionPoint(boofcv.abst.feature.describe.DescribeRegionPoint) ConfigGeneralDetector(boofcv.abst.feature.detect.interest.ConfigGeneralDetector) DetectDescribeMultiFusion(boofcv.abst.feature.detdesc.DetectDescribeMultiFusion) DetectorInterestPointMulti(boofcv.abst.feature.detect.interest.DetectorInterestPointMulti) ScoreAssociateHamming_B(boofcv.abst.feature.associate.ScoreAssociateHamming_B) FactoryPointTrackerTwoPass(boofcv.factory.feature.tracker.FactoryPointTrackerTwoPass) PointTrackerTwoPass(boofcv.abst.feature.tracker.PointTrackerTwoPass) ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) DetectDescribeMulti(boofcv.abst.feature.detdesc.DetectDescribeMulti) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector) PointTrackerToTwoPass(boofcv.abst.feature.tracker.PointTrackerToTwoPass) AssociateDescription2D(boofcv.abst.feature.associate.AssociateDescription2D) PointTracker(boofcv.abst.feature.tracker.PointTracker) FactoryPointTracker(boofcv.factory.feature.tracker.FactoryPointTracker) GeneralFeatureIntensity(boofcv.abst.feature.detect.intensity.GeneralFeatureIntensity)

Example 2 with ScoreAssociateHamming_B

use of boofcv.abst.feature.associate.ScoreAssociateHamming_B in project BoofCV by lessthanoptimal.

the class TestDdaManagerGeneralPoint 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(-1, 2, 0), false, GrayF32.class);
    ScoreAssociateHamming_B score = new ScoreAssociateHamming_B();
    AssociateDescription2D<TupleDesc_B> association = new AssociateDescTo2D<>(FactoryAssociation.greedy(score, 400, true));
    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);
    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) 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 3 with ScoreAssociateHamming_B

use of boofcv.abst.feature.associate.ScoreAssociateHamming_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 4 with ScoreAssociateHamming_B

use of boofcv.abst.feature.associate.ScoreAssociateHamming_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 5 with ScoreAssociateHamming_B

use of boofcv.abst.feature.associate.ScoreAssociateHamming_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)

Aggregations

ScoreAssociateHamming_B (boofcv.abst.feature.associate.ScoreAssociateHamming_B)6 ConfigGeneralDetector (boofcv.abst.feature.detect.interest.ConfigGeneralDetector)6 TupleDesc_B (boofcv.struct.feature.TupleDesc_B)4 GrayF32 (boofcv.struct.image.GrayF32)4 Random (java.util.Random)4 AssociateDescTo2D (boofcv.abst.feature.associate.AssociateDescTo2D)2 AssociateDescription2D (boofcv.abst.feature.associate.AssociateDescription2D)2 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)2 WrapDescribeBrief (boofcv.abst.feature.describe.WrapDescribeBrief)2 PointTracker (boofcv.abst.feature.tracker.PointTracker)2 PointTrackerToTwoPass (boofcv.abst.feature.tracker.PointTrackerToTwoPass)2 PointTrackerTwoPass (boofcv.abst.feature.tracker.PointTrackerTwoPass)2 EasyGeneralFeatureDetector (boofcv.alg.feature.detect.interest.EasyGeneralFeatureDetector)2 GeneralFeatureDetector (boofcv.alg.feature.detect.interest.GeneralFeatureDetector)2 PkltConfig (boofcv.alg.tracker.klt.PkltConfig)2 FactoryDescribeRegionPoint (boofcv.factory.feature.describe.FactoryDescribeRegionPoint)2 FactoryPointTracker (boofcv.factory.feature.tracker.FactoryPointTracker)2 FactoryPointTrackerTwoPass (boofcv.factory.feature.tracker.FactoryPointTrackerTwoPass)2 DetectDescribeFusion (boofcv.abst.feature.detdesc.DetectDescribeFusion)1 DetectDescribeMulti (boofcv.abst.feature.detdesc.DetectDescribeMulti)1