Search in sources :

Example 1 with SiftDetector

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

the class TestWrapSiftDetector method testAllImageTypes.

@Test
public void testAllImageTypes() {
    for (Class type : types) {
        SiftDetector detector = FactoryInterestPointAlgs.sift(null, null);
        WrapSiftDetector alg = new WrapSiftDetector(detector, type);
        new GeneralInterestPointDetectorChecks(alg, false, true, type) {
        }.performAllTests();
    }
}
Also used : WrapSiftDetector(boofcv.abst.feature.detect.interest.WrapSiftDetector) SiftDetector(boofcv.alg.feature.detect.interest.SiftDetector) WrapSiftDetector(boofcv.abst.feature.detect.interest.WrapSiftDetector) Test(org.junit.Test)

Example 2 with SiftDetector

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

the class DebugSiftDetectorApp method main.

public static void main(String[] args) {
    BufferedImage input = UtilImageIO.loadImage(UtilIO.pathExample("sunflowers.jpg"));
    // BufferedImage input = UtilImageIO.loadImage(UtilIO.pathExample("shapes/shapes01.png");
    GrayF32 gray = ConvertBufferedImage.convertFromSingle(input, null, GrayF32.class);
    NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(3, 1, 1, true, true, true));
    NonMaxLimiter extractor = new NonMaxLimiter(nonmax, 400);
    SiftScaleSpace imageSS = new SiftScaleSpace(-1, 5, 3, 2.75);
    SiftDetector alg = new SiftDetector(imageSS, 10, extractor);
    alg.process(gray);
    System.out.println("total features found: " + alg.getDetections().size());
    VisualizeFeatures.drawScalePoints(input.createGraphics(), alg.getDetections().toList(), 1);
    // ListDisplayPanel dog = new ListDisplayPanel();
    // for( int i = 0; i < alg.getScaleSpace().getDog().length; i++ ) {
    // int scale = i % (alg.getScaleSpace().getNumScales()-1);
    // int octave = i / (alg.getScaleSpace().getNumScales()-1);
    // 
    // BufferedImage img = VisualizeImageData.colorizeSign(alg.getScaleSpace().getDog()[i],null,-1);
    // dog.addImage(img,octave+"  "+scale);
    // }
    // 
    // ListDisplayPanel ss = new ListDisplayPanel();
    // for( int i = 0; i < alg.getScaleSpace().getScale().length; i++ ) {
    // int scale = i % alg.getScaleSpace().getNumScales();
    // int octave = i / alg.getScaleSpace().getNumScales();
    // 
    // BufferedImage img = VisualizeImageData.grayMagnitude(alg.getScaleSpace().getScale()[i],null,255);
    // ss.addImage(img,octave+"  "+scale);
    // }
    // ShowImages.showWindow(dog, "Octave DOG");
    // ShowImages.showWindow(ss, "Octave Scales");
    ShowImages.showWindow(input, "Found Features", true);
    System.out.println("Done");
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxLimiter(boofcv.abst.feature.detect.extract.NonMaxLimiter) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayF32(boofcv.struct.image.GrayF32) SiftScaleSpace(boofcv.alg.feature.detect.interest.SiftScaleSpace) SiftDetector(boofcv.alg.feature.detect.interest.SiftDetector) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage)

Aggregations

SiftDetector (boofcv.alg.feature.detect.interest.SiftDetector)2 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)1 NonMaxLimiter (boofcv.abst.feature.detect.extract.NonMaxLimiter)1 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)1 WrapSiftDetector (boofcv.abst.feature.detect.interest.WrapSiftDetector)1 SiftScaleSpace (boofcv.alg.feature.detect.interest.SiftScaleSpace)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 GrayF32 (boofcv.struct.image.GrayF32)1 BufferedImage (java.awt.image.BufferedImage)1 Test (org.junit.Test)1