Search in sources :

Example 1 with ConfigExtract

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

the class ConfigSiftDetector method createPaper.

/**
 * Creates a configuration similar to how it was originally described in the paper
 */
public static ConfigSiftDetector createPaper() {
    ConfigSiftDetector config = new ConfigSiftDetector();
    config.extract = new ConfigExtract(1, 0, 1, true, true, true);
    config.extract.ignoreBorder = 1;
    config.maxFeaturesPerScale = 0;
    config.edgeR = 10;
    return config;
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract)

Example 2 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract 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 WrapperHessianBlobIntensity<>(HessianBlobIntensity.Type.DETERMINANT, derivType);
    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) WrapperHessianBlobIntensity(boofcv.abst.feature.detect.intensity.WrapperHessianBlobIntensity)

Example 3 with ConfigExtract

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

the class FactoryInterestPointAlgs method harrisPyramid.

/**
 * Creates a {@link FeaturePyramid} 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>> FeaturePyramid<T, D> harrisPyramid(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);
    return new FeaturePyramid<>(detector, 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 4 with ConfigExtract

use of boofcv.abst.feature.detect.extract.ConfigExtract 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 WrapperHessianBlobIntensity<>(HessianBlobIntensity.Type.DETERMINANT, derivType);
    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);
    return new FeaturePyramid<>(detector, deriv, 2);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) WrapperHessianBlobIntensity(boofcv.abst.feature.detect.intensity.WrapperHessianBlobIntensity)

Example 5 with ConfigExtract

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

the class CompareFeatureExtractorApp method doProcess.

private synchronized void doProcess() {
    // System.out.println("radius "+radius+" min separation "+minSeparation+" thresholdFraction "+thresholdFraction+" numFeatures "+numFeatures);
    deriv.setInput(grayImage);
    D derivX = deriv.getDerivative(true);
    D derivY = deriv.getDerivative(false);
    D derivXX = deriv.getDerivative(true, true);
    D derivYY = deriv.getDerivative(false, false);
    D derivXY = deriv.getDerivative(true, false);
    // todo modifying buffered images which might be actively being displayed, could mess up swing
    intensityAlg.process(grayImage, derivX, derivY, derivXX, derivYY, derivXY);
    GrayF32 intensity = intensityAlg.getIntensity();
    intensityImage = VisualizeImageData.colorizeSign(intensityAlg.getIntensity(), null, ImageStatistics.maxAbs(intensity));
    float max = ImageStatistics.maxAbs(intensity);
    float threshold = max * thresholdFraction;
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(minSeparation, threshold, radius, true));
    GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensityAlg, extractor);
    detector.setMaxFeatures(numFeatures);
    detector.process(grayImage, derivX, derivY, derivXX, derivYY, derivXY);
    QueueCorner foundCorners = detector.getMaximums();
    render.reset();
    for (int i = 0; i < foundCorners.size(); i++) {
        Point2D_I16 p = foundCorners.get(i);
        render.addPoint(p.x, p.y, 3, Color.RED);
    }
    Graphics2D g2 = workImage.createGraphics();
    g2.drawImage(input, 0, 0, grayImage.width, grayImage.height, null);
    render.draw(g2);
    drawImage();
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayF32(boofcv.struct.image.GrayF32) Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner) GeneralFeatureDetector(boofcv.alg.feature.detect.interest.GeneralFeatureDetector) FactoryIntensityPoint(boofcv.factory.feature.detect.intensity.FactoryIntensityPoint)

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