Search in sources :

Example 1 with WrapperHessianDerivBlobIntensity

use of boofcv.abst.feature.detect.intensity.WrapperHessianDerivBlobIntensity in project BoofCV by lessthanoptimal.

the class FactoryInterestPointAlgs method hessianPyramid.

/**
 * Creates a {@link FeaturePyramid} which is uses a hessian blob 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>> FeaturePyramid<T, D> hessianPyramid(int extractRadius, float detectThreshold, int maxFeatures, Class<T> imageType, Class<D> derivType) {
    GeneralFeatureIntensity<T, D> intensity = new WrapperHessianDerivBlobIntensity<>(HessianBlobIntensity.Type.DETERMINANT, derivType);
    NonMaxSuppression extractorMin = intensity.localMinimums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.min(extractRadius, detectThreshold, extractRadius, true)) : null;
    NonMaxSuppression extractorMax = intensity.localMaximums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.max(extractRadius, detectThreshold, extractRadius, true)) : null;
    FeatureSelectLimitIntensity<Point2D_I16> selector = new FeatureSelectNBest<>(new SampleIntensityImage.I16());
    GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractorMin, extractorMax, selector);
    detector.setFeatureLimit(maxFeatures);
    AnyImageDerivative<T, D> deriv = GImageDerivativeOps.derivativeForScaleSpace(imageType, derivType);
    return new FeaturePyramid<>(detector, deriv, 2);
}
Also used : FeatureSelectNBest(boofcv.alg.feature.detect.selector.FeatureSelectNBest) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) Point2D_I16(georegression.struct.point.Point2D_I16) SampleIntensityImage(boofcv.alg.feature.detect.selector.SampleIntensityImage) WrapperHessianDerivBlobIntensity(boofcv.abst.feature.detect.intensity.WrapperHessianDerivBlobIntensity)

Example 2 with WrapperHessianDerivBlobIntensity

use of boofcv.abst.feature.detect.intensity.WrapperHessianDerivBlobIntensity in project BoofCV by lessthanoptimal.

the class FactoryInterestPointAlgs method hessianLaplace.

/**
 * Creates a {@link boofcv.alg.feature.detect.interest.FeatureLaplacePyramid} which is uses a hessian blob 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> hessianLaplace(int extractRadius, float detectThreshold, int maxFeatures, Class<T> imageType, Class<D> derivType) {
    GeneralFeatureIntensity<T, D> intensity = new WrapperHessianDerivBlobIntensity<>(HessianBlobIntensity.Type.DETERMINANT, derivType);
    NonMaxSuppression extractorMin = intensity.localMinimums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.min(extractRadius, detectThreshold, extractRadius, true)) : null;
    NonMaxSuppression extractorMax = intensity.localMaximums() ? FactoryFeatureExtractor.nonmax(ConfigExtract.max(extractRadius, detectThreshold, extractRadius, true)) : null;
    FeatureSelectLimitIntensity<Point2D_I16> selector = new FeatureSelectNBest<>(new SampleIntensityImage.I16());
    GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractorMin, extractorMax, selector);
    detector.setFeatureLimit(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 : FeatureSelectNBest(boofcv.alg.feature.detect.selector.FeatureSelectNBest) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) Point2D_I16(georegression.struct.point.Point2D_I16) SampleIntensityImage(boofcv.alg.feature.detect.selector.SampleIntensityImage) WrapperHessianDerivBlobIntensity(boofcv.abst.feature.detect.intensity.WrapperHessianDerivBlobIntensity)

Aggregations

NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)2 WrapperHessianDerivBlobIntensity (boofcv.abst.feature.detect.intensity.WrapperHessianDerivBlobIntensity)2 FeatureSelectNBest (boofcv.alg.feature.detect.selector.FeatureSelectNBest)2 SampleIntensityImage (boofcv.alg.feature.detect.selector.SampleIntensityImage)2 Point2D_I16 (georegression.struct.point.Point2D_I16)2