Search in sources :

Example 1 with BrightFeature

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

the class TestDetectDescribeFusion method checkWithOrientation.

@Test
public void checkWithOrientation() {
    final InterestPointDetector<GrayF32> detector = FactoryInterestPoint.fastHessian(null);
    final OrientationImage ori = FactoryOrientationAlgs.nogradient(1.0 / 2.0, 5, GrayF32.class);
    final DescribeRegionPoint<GrayF32, BrightFeature> desc = FactoryDescribeRegionPoint.surfStable(null, GrayF32.class);
    new GenericTestsDetectDescribePoint(true, true, ImageType.single(GrayF32.class), BrightFeature.class) {

        @Override
        public DetectDescribePoint createDetDesc() {
            return new DetectDescribeFusion(detector, ori, desc);
        }
    }.allTests();
}
Also used : OrientationImage(boofcv.abst.feature.orientation.OrientationImage) BrightFeature(boofcv.struct.feature.BrightFeature) GrayF32(boofcv.struct.image.GrayF32) Test(org.junit.Test)

Example 2 with BrightFeature

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

the class TestWrapAssociateSurfBasic method c.

@Override
protected BrightFeature c(double value) {
    BrightFeature s = new BrightFeature(1);
    s.value[0] = value;
    return s;
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature)

Example 3 with BrightFeature

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

the class DescribePointSurf method describe.

/**
 * Compute SURF descriptor, but without laplacian sign
 *
 * @param x Location of interest point.
 * @param y Location of interest point.
 * @param angle The angle the feature is pointing at in radians.
 * @param scale Scale of the interest point. Null is returned if the feature goes outside the image border.
 * @param ret storage for the feature. Must have 64 values.
 */
public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret) {
    double c = Math.cos(angle), s = Math.sin(angle);
    // By assuming that the entire feature is inside the image faster algorithms can be used
    // the results are also of dubious value when interacting with the image border.
    boolean isInBounds = SurfDescribeOps.isInside(ii, x, y, radiusDescriptor, widthSample, scale, c, s);
    // declare the feature if needed
    if (ret == null)
        ret = new BrightFeature(featureDOF);
    else if (ret.value.length != featureDOF)
        throw new IllegalArgumentException("Provided feature must have " + featureDOF + " values");
    gradient.setImage(ii);
    gradient.setWidth(widthSample * scale);
    // use a safe method if its along the image border
    SparseImageGradient gradient = isInBounds ? this.gradient : this.gradientSafe;
    // extract descriptor
    features(x, y, c, s, scale, gradient, ret.value);
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature) SparseImageGradient(boofcv.struct.sparse.SparseImageGradient)

Example 4 with BrightFeature

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

the class AssociateSurfBasic method sort.

/**
 * Splits the set of input features into positive and negative laplacian lists.
 * Keep track of the feature's index in the original input list.  This is
 * the index that needs to be returned.
 */
private void sort(FastQueue<BrightFeature> input, FastQueue<Helper> pos, FastQueue<Helper> neg) {
    pos.reset();
    neg.reset();
    for (int i = 0; i < input.size; i++) {
        BrightFeature f = input.get(i);
        if (f.white) {
            pos.grow().wrap(f, i);
        } else {
            neg.grow().wrap(f, i);
        }
    }
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature)

Example 5 with BrightFeature

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

the class CompleteSift method handleDetection.

@Override
protected void handleDetection(ScalePoint p) {
    // adjust the image for the down sampling in each octave
    double localX = p.x / pixelScaleToInput;
    double localY = p.y / pixelScaleToInput;
    double localSigma = p.scale / pixelScaleToInput;
    // find potential orientations first
    orientation.process(localX, localY, localSigma);
    // describe each feature
    GrowQueue_F64 angles = orientation.getOrientations();
    for (int i = 0; i < angles.size; i++) {
        BrightFeature feature = features.grow();
        feature.white = p.white;
        describe.process(localX, localY, localSigma, angles.get(i), feature);
        orientations.add(angles.get(i));
        locations.add(p);
    }
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature) GrowQueue_F64(org.ddogleg.struct.GrowQueue_F64) ScalePoint(boofcv.struct.feature.ScalePoint)

Aggregations

BrightFeature (boofcv.struct.feature.BrightFeature)22 Test (org.junit.Test)11 GrayF32 (boofcv.struct.image.GrayF32)6 DetectDescribePoint (boofcv.abst.feature.detdesc.DetectDescribePoint)4 ConfigFastHessian (boofcv.abst.feature.detect.interest.ConfigFastHessian)4 AssociatedIndex (boofcv.struct.feature.AssociatedIndex)3 ScalePoint (boofcv.struct.feature.ScalePoint)3 AssociatedPair (boofcv.struct.geo.AssociatedPair)3 OrientationImage (boofcv.abst.feature.orientation.OrientationImage)2 ArrayList (java.util.ArrayList)2 FastQueue (org.ddogleg.struct.FastQueue)2 GrowQueue_F64 (org.ddogleg.struct.GrowQueue_F64)2 GrowQueue_I32 (org.ddogleg.struct.GrowQueue_I32)2 ConfigExtract (boofcv.abst.feature.detect.extract.ConfigExtract)1 NonMaxSuppression (boofcv.abst.feature.detect.extract.NonMaxSuppression)1 FastHessianFeatureDetector (boofcv.alg.feature.detect.interest.FastHessianFeatureDetector)1 ExampleAssociatePoints (boofcv.examples.features.ExampleAssociatePoints)1 ConfigRansac (boofcv.factory.geo.ConfigRansac)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 SurfFeatureQueue (boofcv.struct.feature.SurfFeatureQueue)1