use of boofcv.abst.feature.detect.extract.NonMaxSuppression in project BoofCV by lessthanoptimal.
the class TestCompleteSift method createAlg.
private CompleteSift createAlg() {
SiftScaleSpace ss = new SiftScaleSpace(-1, 4, 3, 1.6);
NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(1, 0, 1, true, true, true));
NonMaxLimiter limiter = new NonMaxLimiter(nonmax, 300);
OrientationHistogramSift<GrayF32> ori = new OrientationHistogramSift<>(36, 1.5, GrayF32.class);
DescribePointSift<GrayF32> describe = new DescribePointSift<>(4, 4, 8, 1.5, 0.5, 0.2, GrayF32.class);
return new CompleteSift(ss, 10, limiter, ori, describe);
}
use of boofcv.abst.feature.detect.extract.NonMaxSuppression in project BoofCV by lessthanoptimal.
the class DetectFastHessianApp method doStuff.
private static <T extends ImageGray<T>> void doStuff(Class<T> imageType, BufferedImage input) {
T workImage = ConvertBufferedImage.convertFromSingle(input, null, imageType);
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(5, 1, 5, true));
FastHessianFeatureDetector<T> det = new FastHessianFeatureDetector<>(extractor, NUM_FEATURES, 2, 9, 4, 4, 6);
T integral = GIntegralImageOps.transform(workImage, null);
det.detect(integral);
System.out.println("total features found: " + det.getFoundPoints().size());
VisualizeFeatures.drawScalePoints(input.createGraphics(), det.getFoundPoints(), BoofDefaults.SURF_SCALE_TO_RADIUS);
ShowImages.showWindow(input, "Found Features: " + imageType.getSimpleName(), true);
}
use of boofcv.abst.feature.detect.extract.NonMaxSuppression in project BoofCV by lessthanoptimal.
the class VideoDetectCorners method perform.
public static <T extends ImageGray<T>, D extends ImageGray<D>> void perform(String fileName, Class<T> imageType, Class<D> derivType) {
SimpleImageSequence<T> sequence = BoofVideoManager.loadManagerDefault().load(fileName, ImageType.single(imageType));
int maxCorners = 200;
int radius = 2;
GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(FactoryIntensityPointAlg.shiTomasi(radius, false, derivType));
// GeneralFeatureIntensity<T, D> intensity =
// new WrapperFastCornerIntensity<T, D>(FactoryIntensityPointAlg.createFast12(defaultType, 8 , 12));
NonMaxSuppression extractor = new WrapperNonMaximumBlock(new NonMaxBlockStrict.Max());
// FeatureExtractor extractor = new WrapperNonMaximumBlock( new NonMaxExtractorNaive(radius+10,10f));
// FeatureExtractor extractor = new WrapperNonMaxCandidate(new NonMaxCandidateStrict(radius+10, 10f));
extractor.setIgnoreBorder(radius + 10);
extractor.setThresholdMaximum(10f);
GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractor);
detector.setMaxFeatures(maxCorners);
VideoDetectCorners<T, D> display = new VideoDetectCorners<>(sequence, detector, derivType);
display.process();
}
use of boofcv.abst.feature.detect.extract.NonMaxSuppression in project BoofCV by lessthanoptimal.
the class FactoryDetectPoint method createGeneral.
public static <T extends ImageGray<T>, D extends ImageGray<D>> GeneralFeatureDetector<T, D> createGeneral(GeneralFeatureIntensity<T, D> intensity, ConfigGeneralDetector config) {
// create a copy since it's going to modify the detector config
ConfigGeneralDetector foo = new ConfigGeneralDetector();
foo.setTo(config);
config = foo;
config.ignoreBorder += config.radius;
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(config);
GeneralFeatureDetector<T, D> det = new GeneralFeatureDetector<>(intensity, extractor);
det.setMaxFeatures(config.maxFeatures);
return det;
}
use of boofcv.abst.feature.detect.extract.NonMaxSuppression in project BoofCV by lessthanoptimal.
the class FactoryInterestPoint method sift.
public static <T extends ImageGray<T>> InterestPointDetector<T> sift(ConfigSiftScaleSpace configSS, ConfigSiftDetector configDet, Class<T> imageType) {
if (configSS == null)
configSS = new ConfigSiftScaleSpace();
if (configDet == null)
configDet = new ConfigSiftDetector();
SiftScaleSpace scaleSpace = new SiftScaleSpace(configSS.firstOctave, configSS.lastOctave, configSS.numScales, configSS.sigma0);
NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(configDet.extract);
NonMaxLimiter limiter = new NonMaxLimiter(nonmax, configDet.maxFeaturesPerScale);
SiftDetector detector = new SiftDetector(scaleSpace, configDet.edgeR, limiter);
return new WrapSiftDetector<>(detector, imageType);
}
Aggregations