Search in sources :

Example 11 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.

the class TestCompleteSift method createAlg.

private CompleteSift createAlg() {
    SiftScaleSpace ss = new SiftScaleSpace(-1, 4, 3, 1.6);
    NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(1, 0, 1, true, true, true));
    NonMaxLimiter limiter = new NonMaxLimiter(nonmax, 300);
    OrientationHistogramSift<GrayF32> ori = new OrientationHistogramSift<>(36, 1.5, GrayF32.class);
    DescribePointSift<GrayF32> describe = new DescribePointSift<>(4, 4, 8, 1.5, 0.5, 0.2, GrayF32.class);
    return new CompleteSift(ss, 10, limiter, ori, describe);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxLimiter(boofcv.abst.feature.detect.extract.NonMaxLimiter) OrientationHistogramSift(boofcv.alg.feature.orientation.OrientationHistogramSift) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayF32(boofcv.struct.image.GrayF32) DescribePointSift(boofcv.alg.feature.describe.DescribePointSift) SiftScaleSpace(boofcv.alg.feature.detect.interest.SiftScaleSpace)

Example 12 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.

the class DetectFastHessianApp method doStuff.

private static <T extends ImageGray<T>> void doStuff(Class<T> imageType, BufferedImage input) {
    T workImage = ConvertBufferedImage.convertFromSingle(input, null, imageType);
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(5, 1, 5, true));
    FastHessianFeatureDetector<T> det = new FastHessianFeatureDetector<>(extractor, NUM_FEATURES, 2, 9, 4, 4, 6);
    T integral = GIntegralImageOps.transform(workImage, null);
    det.detect(integral);
    System.out.println("total features found: " + det.getFoundPoints().size());
    VisualizeFeatures.drawScalePoints(input.createGraphics(), det.getFoundPoints(), BoofDefaults.SURF_SCALE_TO_RADIUS);
    ShowImages.showWindow(input, "Found Features: " + imageType.getSimpleName(), true);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) FastHessianFeatureDetector(boofcv.alg.feature.detect.interest.FastHessianFeatureDetector)

Example 13 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.

the class FactoryInterestPointAlgs method fastHessian.

/**
 * Creates a Fast Hessian blob detector used by SURF.
 *
 * @param config Configuration for detector. Pass in null for default options.
 * @param <II> Integral Image
 * @return The feature detector
 */
public static <II extends ImageGray<II>> FastHessianFeatureDetector<II> fastHessian(@Nullable ConfigFastHessian config) {
    if (config == null)
        config = new ConfigFastHessian();
    config.checkValidity();
    // ignore border is overwritten by Fast Hessian at detection time
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(config.extractRadius, config.detectThreshold, 0, true));
    return new FastHessianFeatureDetector<>(extractor, config.maxFeaturesPerScale, config.initialSampleSize, config.initialSize, config.numberScalesPerOctave, config.numberOfOctaves, config.scaleStepSize);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) ConfigFastHessian(boofcv.abst.feature.detect.interest.ConfigFastHessian)

Example 14 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.

the class FactoryInterestPointAlgs method harrisLaplace.

/**
 * Creates a {@link FeatureLaplacePyramid} which is uses the Harris corner detector.
 *
 * @param extractRadius   Size of the feature used to detect the corners.
 * @param detectThreshold Minimum corner intensity required
 * @param maxFeatures     Max number of features that can be found.
 * @param imageType       Type of input image.
 * @param derivType       Image derivative type.
 * @return CornerLaplaceScaleSpace
 */
public static <T extends ImageGray<T>, D extends ImageGray<D>> FeatureLaplacePyramid<T, D> harrisLaplace(int extractRadius, float detectThreshold, int maxFeatures, Class<T> imageType, Class<D> derivType) {
    GradientCornerIntensity<D> harris = FactoryIntensityPointAlg.harris(extractRadius, 0.04f, false, derivType);
    GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(harris);
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(extractRadius, detectThreshold, extractRadius, true));
    GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractor);
    detector.setMaxFeatures(maxFeatures);
    AnyImageDerivative<T, D> deriv = GImageDerivativeOps.derivativeForScaleSpace(imageType, derivType);
    ImageFunctionSparse<T> sparseLaplace = FactoryDerivativeSparse.createLaplacian(imageType, null);
    return new FeatureLaplacePyramid<>(detector, sparseLaplace, deriv, 2);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) WrapperGradientCornerIntensity(boofcv.abst.feature.detect.intensity.WrapperGradientCornerIntensity)

Example 15 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.

the class TestWrapVisOdomQuadPnP method createAlgorithm.

@Override
public StereoVisualOdometry<GrayF32> createAlgorithm() {
    GeneralFeatureIntensity intensity = FactoryIntensityPoint.shiTomasi(1, false, GrayF32.class);
    NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(2, 1, 0, true, false, true));
    GeneralFeatureDetector<GrayF32, GrayF32> general = new GeneralFeatureDetector<>(intensity, nonmax);
    general.setMaxFeatures(600);
    DetectorInterestPointMulti detector = new GeneralToInterestMulti(general, 2, GrayF32.class, GrayF32.class);
    DescribeRegionPoint describe = FactoryDescribeRegionPoint.surfFast(null, GrayF32.class);
    DetectDescribeMulti detDescMulti = new DetectDescribeMultiFusion(detector, null, describe);
    return FactoryVisualOdometry.stereoQuadPnP(1.5, 0.5, 200, Double.MAX_VALUE, 300, 50, detDescMulti, GrayF32.class);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) DetectDescribeMulti(boofcv.abst.feature.detdesc.DetectDescribeMulti) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayF32(boofcv.struct.image.GrayF32) GeneralToInterestMulti(boofcv.abst.feature.detect.interest.GeneralToInterestMulti) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector) DescribeRegionPoint(boofcv.abst.feature.describe.DescribeRegionPoint) FactoryDescribeRegionPoint(boofcv.factory.feature.describe.FactoryDescribeRegionPoint) DetectDescribeMultiFusion(boofcv.abst.feature.detdesc.DetectDescribeMultiFusion) DetectorInterestPointMulti(boofcv.abst.feature.detect.interest.DetectorInterestPointMulti) GeneralFeatureIntensity(boofcv.abst.feature.detect.intensity.GeneralFeatureIntensity)

Aggregations

ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)20 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)19 GrayF32 (boofcv.struct.image.GrayF32)6 NonMaxLimiter (boofcv.abst.feature.detect.extract.NonMaxLimiter)3 GeneralFeatureDetector (boofcv.alg.feature.detect.interest.GeneralFeatureDetector)3 QueueCorner (boofcv.struct.QueueCorner)3 Point2D_I16 (georegression.struct.point.Point2D_I16)3 Test (org.junit.Test)3 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)2 DetectDescribeMulti (boofcv.abst.feature.detdesc.DetectDescribeMulti)2 DetectDescribeMultiFusion (boofcv.abst.feature.detdesc.DetectDescribeMultiFusion)2 GeneralFeatureIntensity (boofcv.abst.feature.detect.intensity.GeneralFeatureIntensity)2 WrapperGradientCornerIntensity (boofcv.abst.feature.detect.intensity.WrapperGradientCornerIntensity)2 WrapperHessianBlobIntensity (boofcv.abst.feature.detect.intensity.WrapperHessianBlobIntensity)2 DetectorInterestPointMulti (boofcv.abst.feature.detect.interest.DetectorInterestPointMulti)2 GeneralToInterestMulti (boofcv.abst.feature.detect.interest.GeneralToInterestMulti)2 FastHessianFeatureDetector (boofcv.alg.feature.detect.interest.FastHessianFeatureDetector)2 SiftScaleSpace (boofcv.alg.feature.detect.interest.SiftScaleSpace)2 FactoryDescribeRegionPoint (boofcv.factory.feature.describe.FactoryDescribeRegionPoint)2 FactoryIntensityPoint (boofcv.factory.feature.detect.intensity.FactoryIntensityPoint)2