use of boofcv.abst.feature.detect.interest.ConfigFastHessian 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;
}
use of boofcv.abst.feature.detect.interest.ConfigFastHessian in project BoofCV by lessthanoptimal.
the class FactoryInterestPointAlgs method fastHessian.
/**
* Creates a Fast Hessian blob detector used by SURF.
*
* @param config Configuration for detector. Pass in null for default options.
* @param <II> Integral Image
* @return The feature detector
*/
public static <II extends ImageGray<II>> FastHessianFeatureDetector<II> fastHessian(@Nullable ConfigFastHessian config) {
if (config == null)
config = new ConfigFastHessian();
config.checkValidity();
// ignore border is overwritten by Fast Hessian at detection time
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(config.extractRadius, config.detectThreshold, 0, true));
return new FastHessianFeatureDetector<>(extractor, config.maxFeaturesPerScale, config.initialSampleSize, config.initialSize, config.numberScalesPerOctave, config.numberOfOctaves, config.scaleStepSize);
}
use of boofcv.abst.feature.detect.interest.ConfigFastHessian in project BoofCV by lessthanoptimal.
the class ExampleInterestPoint method detect.
public static <T extends ImageGray<T>> void detect(BufferedImage image, Class<T> imageType) {
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
// Create a Fast Hessian detector from the SURF paper.
// Other detectors can be used in this example too.
InterestPointDetector<T> detector = FactoryInterestPoint.fastHessian(new ConfigFastHessian(10, 2, 100, 2, 9, 3, 4));
// find interest points in the image
detector.detect(input);
// Show the features
displayResults(image, detector);
}
use of boofcv.abst.feature.detect.interest.ConfigFastHessian in project BoofCV by lessthanoptimal.
the class ExampleAssociatePoints method main.
public static void main(String[] args) {
Class imageType = GrayF32.class;
// Class imageType = GrayU8.class;
// select which algorithms to use
DetectDescribePoint detDesc = FactoryDetectDescribe.surfStable(new ConfigFastHessian(1, 2, 300, 1, 9, 4, 4), null, null, imageType);
// sift(new ConfigCompleteSift(0,5,600));
ScoreAssociation scorer = FactoryAssociation.defaultScore(detDesc.getDescriptionType());
AssociateDescription associate = FactoryAssociation.greedy(scorer, Double.MAX_VALUE, true);
// load and match images
ExampleAssociatePoints app = new ExampleAssociatePoints(detDesc, associate, imageType);
BufferedImage imageA = UtilImageIO.loadImage(UtilIO.pathExample("stitch/kayak_01.jpg"));
BufferedImage imageB = UtilImageIO.loadImage(UtilIO.pathExample("stitch/kayak_03.jpg"));
app.associate(imageA, imageB);
}
use of boofcv.abst.feature.detect.interest.ConfigFastHessian in project BoofCV by lessthanoptimal.
the class ExampleFeatureSurf method easy.
/**
* Use generalized interfaces for working with SURF. This removes much of the drudgery, but also reduces flexibility
* and slightly increases memory and computational requirements.
*
* @param image Input image type. DOES NOT NEED TO BE GrayF32, GrayU8 works too
*/
public static void easy(GrayF32 image) {
// create the detector and descriptors
DetectDescribePoint<GrayF32, BrightFeature> surf = FactoryDetectDescribe.surfStable(new ConfigFastHessian(0, 2, 200, 2, 9, 4, 4), null, null, GrayF32.class);
// specify the image to process
surf.detect(image);
System.out.println("Found Features: " + surf.getNumberOfFeatures());
System.out.println("First descriptor's first value: " + surf.getDescription(0).value[0]);
}
Aggregations