Search in sources :

Example 16 with BrightFeature

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

the class TestCompleteSift method basic.

/**
 * Doesn't do much more than see if it blows up and the expected size of objects is returned
 */
@Test
public void basic() {
    GrayF32 image = new GrayF32(300, 290);
    GImageMiscOps.fillUniform(image, rand, 0, 200);
    CompleteSift alg = createAlg();
    alg.process(image);
    assertEquals(128, alg.getDescriptorLength());
    GrowQueue_F64 orientations = alg.getOrientations();
    FastQueue<ScalePoint> locations = alg.getLocations();
    FastQueue<BrightFeature> descriptions = alg.getDescriptions();
    assertTrue(orientations.size > 10);
    assertEquals(orientations.size, locations.size);
    assertEquals(orientations.size, descriptions.size);
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature) GrayF32(boofcv.struct.image.GrayF32) ScalePoint(boofcv.struct.feature.ScalePoint) GrowQueue_F64(org.ddogleg.struct.GrowQueue_F64) Test(org.junit.Test)

Example 17 with BrightFeature

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

the class TestAssociateSurfBasic method createDesc.

private BrightFeature createDesc(boolean laplace, double value) {
    BrightFeature ret = new BrightFeature(64);
    ret.white = laplace;
    ret.value[0] = value;
    return ret;
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature)

Example 18 with BrightFeature

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

the class ExampleMultiviewSceneReconstruction method detectImageFeatures.

/**
 * Detect image features in all the images.  Save location, description, and color
 */
private void detectImageFeatures(List<BufferedImage> colorImages) {
    System.out.println("Detecting Features in each image.  Total " + colorImages.size());
    for (int i = 0; i < colorImages.size(); i++) {
        System.out.print("*");
        BufferedImage colorImage = colorImages.get(i);
        FastQueue<BrightFeature> features = new SurfFeatureQueue(64);
        FastQueue<Point2D_F64> pixels = new FastQueue<>(Point2D_F64.class, true);
        GrowQueue_I32 colors = new GrowQueue_I32();
        detectFeatures(colorImage, features, pixels, colors);
        imageVisualFeatures.add(features);
        imagePixels.add(pixels);
        imageColors.add(colors);
    }
    System.out.println();
}
Also used : BrightFeature(boofcv.struct.feature.BrightFeature) SurfFeatureQueue(boofcv.struct.feature.SurfFeatureQueue) Point2D_F64(georegression.struct.point.Point2D_F64) FastQueue(org.ddogleg.struct.FastQueue) DetectDescribePoint(boofcv.abst.feature.detdesc.DetectDescribePoint) BufferedImage(java.awt.image.BufferedImage) ConvertBufferedImage(boofcv.io.image.ConvertBufferedImage) GrowQueue_I32(org.ddogleg.struct.GrowQueue_I32)

Example 19 with BrightFeature

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

the class ExampleFundamentalMatrix method computeMatches.

/**
 * Use the associate point feature example to create a list of {@link AssociatedPair} for use in computing the
 * fundamental matrix.
 */
public static List<AssociatedPair> computeMatches(BufferedImage left, BufferedImage right) {
    DetectDescribePoint detDesc = FactoryDetectDescribe.surfStable(new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null, null, GrayF32.class);
    // DetectDescribePoint detDesc = FactoryDetectDescribe.sift(null,new ConfigSiftDetector(2,0,200,5),null,null);
    ScoreAssociation<BrightFeature> scorer = FactoryAssociation.scoreEuclidean(BrightFeature.class, true);
    AssociateDescription<BrightFeature> associate = FactoryAssociation.greedy(scorer, 1, true);
    ExampleAssociatePoints<GrayF32, BrightFeature> findMatches = new ExampleAssociatePoints<>(detDesc, associate, GrayF32.class);
    findMatches.associate(left, right);
    List<AssociatedPair> matches = new ArrayList<>();
    FastQueue<AssociatedIndex> matchIndexes = associate.getMatches();
    for (int i = 0; i < matchIndexes.size; i++) {
        AssociatedIndex a = matchIndexes.get(i);
        AssociatedPair p = new AssociatedPair(findMatches.pointsA.get(a.src), findMatches.pointsB.get(a.dst));
        matches.add(p);
    }
    return matches;
}
Also used : DetectDescribePoint(boofcv.abst.feature.detdesc.DetectDescribePoint) AssociatedPair(boofcv.struct.geo.AssociatedPair) ConfigFastHessian(boofcv.abst.feature.detect.interest.ConfigFastHessian) ArrayList(java.util.ArrayList) DetectDescribePoint(boofcv.abst.feature.detdesc.DetectDescribePoint) BrightFeature(boofcv.struct.feature.BrightFeature) GrayF32(boofcv.struct.image.GrayF32) ExampleAssociatePoints(boofcv.examples.features.ExampleAssociatePoints) AssociatedIndex(boofcv.struct.feature.AssociatedIndex)

Example 20 with BrightFeature

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

the class TestDetectDescribeMultiFusion method checkWithOrientation.

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

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

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