use of boofcv.alg.feature.detect.interest.GeneralFeatureDetector 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));
Objects.requireNonNull(sequence);
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));
ConfigExtract config = new ConfigExtract();
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(config);
// 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);
FeatureSelectLimitIntensity<Point2D_I16> selector = new FeatureSelectNBest<>(new SampleIntensityImage.I16());
var detector = new GeneralFeatureDetector<>(intensity, null, extractor, selector);
detector.setFeatureLimit(maxCorners);
VideoDetectCorners<T, D> display = new VideoDetectCorners<>(sequence, detector, derivType);
display.process();
}
use of boofcv.alg.feature.detect.interest.GeneralFeatureDetector in project BoofCV by lessthanoptimal.
the class ExampleDetectDescribe method createFromComponents.
/**
* Any arbitrary implementation of InterestPointDetector, OrientationImage, DescribeRegionPoint
* can be combined into DetectDescribePoint. The syntax is more complex, but the end result is more flexible.
* This should only be done if there isn't a pre-made DetectDescribePoint.
*/
public static <T extends ImageGray<T>, TD extends TupleDesc<TD>> DetectDescribePoint<T, TD> createFromComponents(Class<T> imageType) {
// create a corner detector
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
GeneralFeatureDetector corner = FactoryDetectPoint.createShiTomasi(new ConfigGeneralDetector(1000, 5, 1), null, derivType);
InterestPointDetector detector = FactoryInterestPoint.wrapPoint(corner, 1, imageType, derivType);
// describe points using BRIEF
DescribePointRadiusAngle describe = FactoryDescribePointRadiusAngle.brief(new ConfigBrief(true), imageType);
// NOTE: orientation will not be estimated
return FactoryDetectDescribe.fuseTogether(detector, null, describe);
}
Aggregations