Search in sources :

Example 16 with ScalePoint

use of boofcv.struct.feature.ScalePoint in project BoofCV by lessthanoptimal.

the class TestSiftDetector method processFeatureCandidate_NoChange.

/**
 * Interpolation shouldn't change the location since its equal on all sides
 */
@Test
public void processFeatureCandidate_NoChange() {
    GrayF32 upper = new GrayF32(30, 40);
    GrayF32 current = new GrayF32(30, 40);
    GrayF32 lower = new GrayF32(30, 40);
    SiftDetector alg = createDetector();
    alg.pixelScaleToInput = 2.0;
    alg.sigmaLower = 4;
    alg.sigmaTarget = 5;
    alg.sigmaUpper = 6;
    alg.dogLower = lower;
    alg.dogTarget = current;
    alg.dogUpper = upper;
    alg.derivXX.setImage(current);
    alg.derivXY.setImage(current);
    alg.derivYY.setImage(current);
    for (float sign : new float[] { -1, 1 }) {
        alg.detections.reset();
        current.set(15, 16, sign * 100);
        alg.processFeatureCandidate(15, 16, 100, sign > 0);
        ScalePoint p = alg.getDetections().get(0);
        assertEquals(15 * 2, p.x, 1e-8);
        assertEquals(16 * 2, p.y, 1e-8);
        assertEquals(5, p.scale, 1e-8);
    }
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ScalePoint(boofcv.struct.feature.ScalePoint) Test(org.junit.Test)

Aggregations

ScalePoint (boofcv.struct.feature.ScalePoint)16 GrayF32 (boofcv.struct.image.GrayF32)6 Test (org.junit.Test)4 BrightFeature (boofcv.struct.feature.BrightFeature)3 Point2D_I16 (georegression.struct.point.Point2D_I16)2 GrowQueue_F64 (org.ddogleg.struct.GrowQueue_F64)2 FDistort (boofcv.abst.distort.FDistort)1 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)1 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)1 FastHessianFeatureDetector (boofcv.alg.feature.detect.interest.FastHessianFeatureDetector)1 ImageBorder_F32 (boofcv.core.image.border.ImageBorder_F32)1 ImageGray (boofcv.struct.image.ImageGray)1 ArrayList (java.util.ArrayList)1