Search in sources :

Example 21 with NonMaxSuppression

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

the class TestSiftDetector method createDetector.

private SiftDetector createDetector() {
    SiftScaleSpace ss = new SiftScaleSpace(-1, 5, 3, 1.6);
    NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(1, 0, 1, true, true, true));
    NonMaxLimiter limiter = new NonMaxLimiter(nonmax, 1000);
    return new SiftDetector(ss, 10, limiter);
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxLimiter(boofcv.abst.feature.detect.extract.NonMaxLimiter) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression)

Example 22 with NonMaxSuppression

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

the class TestHoughTransformLinePolar method obviousLines.

/**
 * See if it can detect an obvious line in the image
 */
@Test
public void obviousLines() {
    GrayU8 image = new GrayU8(width, height);
    for (int i = 0; i < height; i++) {
        image.set(5, i, 1);
    }
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(4, 5, 0, true));
    HoughTransformLinePolar alg = new HoughTransformLinePolar(extractor, 40, 180);
    alg.transform(image);
    FastQueue<LineParametric2D_F32> lines = alg.extractLines();
    assertTrue(lines.size() > 0);
    for (int i = 0; i < lines.size(); i++) {
        LineParametric2D_F32 l = lines.get(i);
        assertEquals(l.p.x, 5, 0.1);
        assertEquals(Math.abs(l.slope.x), 0, 1e-4);
        assertEquals(Math.abs(l.slope.y), 1, 0.1);
    }
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) GrayU8(boofcv.struct.image.GrayU8) LineParametric2D_F32(georegression.struct.line.LineParametric2D_F32) Test(org.junit.Test)

Example 23 with NonMaxSuppression

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

the class GeneralTemplateMatchTests method checkExpected.

private void checkExpected(Point2D_I32... points) {
    // I'm being lazy, update this in the future
    assertFalse(alg.isBorderProcessed());
    // only process the regions which are not considered the border
    int x0 = alg.getBorderX0();
    int y0 = alg.getBorderY0();
    // solutions should be local maximums
    NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(2, -Float.MAX_VALUE, 0, true));
    QueueCorner found = new QueueCorner(10);
    extractor.process(alg.getIntensity(), null, null, null, found);
    assertTrue(found.size >= points.length);
    // search for all the expected matches
    for (Point2D_I32 expected : points) {
        int numMatches = 0;
        for (Point2D_I16 f : found.toList()) {
            double d = UtilPoint2D_F64.distance(f.x - x0, f.y - y0, expected.x, expected.y);
            if (d <= 1)
                numMatches++;
        }
        assertEquals(1, numMatches);
    }
}
Also used : ConfigExtract(boofcv.abst.feature.detect.extract.ConfigExtract) NonMaxSuppression(boofcv.abst.feature.detect.extract.NonMaxSuppression) Point2D_I16(georegression.struct.point.Point2D_I16) QueueCorner(boofcv.struct.QueueCorner) Point2D_I32(georegression.struct.point.Point2D_I32)

Aggregations

NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)23 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)19 GrayF32 (boofcv.struct.image.GrayF32)7 NonMaxLimiter (boofcv.abst.feature.detect.extract.NonMaxLimiter)5 GeneralFeatureDetector (boofcv.alg.feature.detect.interest.GeneralFeatureDetector)5 WrapperGradientCornerIntensity (boofcv.abst.feature.detect.intensity.WrapperGradientCornerIntensity)3 SiftScaleSpace (boofcv.alg.feature.detect.interest.SiftScaleSpace)3 QueueCorner (boofcv.struct.QueueCorner)3 Point2D_I16 (georegression.struct.point.Point2D_I16)3 Test (org.junit.Test)3 ConfigSiftScaleSpace (boofcv.abst.feature.describe.ConfigSiftScaleSpace)2 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 WrapperHessianBlobIntensity (boofcv.abst.feature.detect.intensity.WrapperHessianBlobIntensity)2 ConfigGeneralDetector (boofcv.abst.feature.detect.interest.ConfigGeneralDetector)2 DetectorInterestPointMulti (boofcv.abst.feature.detect.interest.DetectorInterestPointMulti)2 GeneralToInterestMulti (boofcv.abst.feature.detect.interest.GeneralToInterestMulti)2 DescribePointSift (boofcv.alg.feature.describe.DescribePointSift)2