Search in sources :

Example 6 with GeneralFeatureDetector

use of boofcv.alg.feature.detect.interest.GeneralFeatureDetector in project BoofCV by lessthanoptimal.

the class VideoDetectCorners method perform.

public static <T extends ImageGray<T>, D extends ImageGray<D>> void perform(String fileName, Class<T> imageType, Class<D> derivType) {
    SimpleImageSequence<T> sequence = BoofVideoManager.loadManagerDefault().load(fileName, ImageType.single(imageType));
    Objects.requireNonNull(sequence);
    int maxCorners = 200;
    int radius = 2;
    GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(FactoryIntensityPointAlg.shiTomasi(radius, false, derivType));
    // GeneralFeatureIntensity<T, D> intensity =
    // new WrapperFastCornerIntensity<T, D>(FactoryIntensityPointAlg.createFast12(defaultType, 8 , 12));
    ConfigExtract config = new ConfigExtract();
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(config);
    // FeatureExtractor extractor = new WrapperNonMaximumBlock( new NonMaxExtractorNaive(radius+10,10f));
    // FeatureExtractor extractor = new WrapperNonMaxCandidate(new NonMaxCandidateStrict(radius+10, 10f));
    extractor.setIgnoreBorder(radius + 10);
    extractor.setThresholdMaximum(10f);
    FeatureSelectLimitIntensity<Point2D_I16> selector = new FeatureSelectNBest<>(new SampleIntensityImage.I16());
    var detector = new GeneralFeatureDetector<>(intensity, null, extractor, selector);
    detector.setFeatureLimit(maxCorners);
    VideoDetectCorners<T, D> display = new VideoDetectCorners<>(sequence, detector, derivType);
    display.process();
}
Also used : FeatureSelectNBest(boofcv.alg.feature.detect.selector.FeatureSelectNBest) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) Point2D_I16(georegression.struct.point.Point2D_I16) ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) SampleIntensityImage(boofcv.alg.feature.detect.selector.SampleIntensityImage) WrapperGradientCornerIntensity(boofcv.abst.feature.detect.intensity.WrapperGradientCornerIntensity) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector)

Example 7 with GeneralFeatureDetector

use of boofcv.alg.feature.detect.interest.GeneralFeatureDetector 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);
}
Also used : ConfigBrief(boofcv.abst.feature.describe.ConfigBrief) InterestPointDetector(boofcv.abst.feature.detect.interest.InterestPointDetector) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector) DescribePointRadiusAngle(boofcv.abst.feature.describe.DescribePointRadiusAngle) FactoryDescribePointRadiusAngle(boofcv.factory.feature.describe.FactoryDescribePointRadiusAngle) ConfigGeneralDetector(boofcv.abst.feature.detect.interest.ConfigGeneralDetector)

Aggregations

GeneralFeatureDetector (boofcv.alg.feature.detect.interest.GeneralFeatureDetector)7 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)5 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)4 ConfigGeneralDetector (boofcv.abst.feature.detect.interest.ConfigGeneralDetector)4 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)3 FactoryDescribeRegionPoint (boofcv.factory.feature.describe.FactoryDescribeRegionPoint)3 AssociateDescription2D (boofcv.abst.feature.associate.AssociateDescription2D)2 ScoreAssociateHamming_B (boofcv.abst.feature.associate.ScoreAssociateHamming_B)2 DetectDescribeMulti (boofcv.abst.feature.detdesc.DetectDescribeMulti)2 DetectDescribeMultiFusion (boofcv.abst.feature.detdesc.DetectDescribeMultiFusion)2 GeneralFeatureIntensity (boofcv.abst.feature.detect.intensity.GeneralFeatureIntensity)2 DetectorInterestPointMulti (boofcv.abst.feature.detect.interest.DetectorInterestPointMulti)2 GeneralToInterestMulti (boofcv.abst.feature.detect.interest.GeneralToInterestMulti)2 PointTracker (boofcv.abst.feature.tracker.PointTracker)2 PointTrackerToTwoPass (boofcv.abst.feature.tracker.PointTrackerToTwoPass)2 PointTrackerTwoPass (boofcv.abst.feature.tracker.PointTrackerTwoPass)2 PkltConfig (boofcv.alg.tracker.klt.PkltConfig)2 FactoryPointTracker (boofcv.factory.feature.tracker.FactoryPointTracker)2 FactoryPointTrackerTwoPass (boofcv.factory.feature.tracker.FactoryPointTrackerTwoPass)2 GrayF32 (boofcv.struct.image.GrayF32)2