use of boofcv.abst.feature.detect.extract.ConfigExtract 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.ConfigExtract 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.ConfigExtract 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.extract.ConfigExtract in project BoofCV by lessthanoptimal.
the class FactoryInterestPointAlgs method harrisLaplace.
/**
* Creates a {@link FeatureLaplacePyramid} which is uses the Harris corner detector.
*
* @param extractRadius Size of the feature used to detect the corners.
* @param detectThreshold Minimum corner intensity required
* @param maxFeatures Max number of features that can be found.
* @param imageType Type of input image.
* @param derivType Image derivative type.
* @return CornerLaplaceScaleSpace
*/
public static <T extends ImageGray<T>, D extends ImageGray<D>> FeatureLaplacePyramid<T, D> harrisLaplace(int extractRadius, float detectThreshold, int maxFeatures, Class<T> imageType, Class<D> derivType) {
GradientCornerIntensity<D> harris = FactoryIntensityPointAlg.harris(extractRadius, 0.04f, false, derivType);
GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(harris);
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(extractRadius, detectThreshold, extractRadius, true));
GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractor);
detector.setMaxFeatures(maxFeatures);
AnyImageDerivative<T, D> deriv = GImageDerivativeOps.derivativeForScaleSpace(imageType, derivType);
ImageFunctionSparse<T> sparseLaplace = FactoryDerivativeSparse.createLaplacian(imageType, null);
return new FeatureLaplacePyramid<>(detector, sparseLaplace, deriv, 2);
}
use of boofcv.abst.feature.detect.extract.ConfigExtract in project BoofCV by lessthanoptimal.
the class TestWrapVisOdomQuadPnP method createAlgorithm.
@Override
public StereoVisualOdometry<GrayF32> createAlgorithm() {
GeneralFeatureIntensity intensity = FactoryIntensityPoint.shiTomasi(1, false, GrayF32.class);
NonMaxSuppression nonmax = FactoryFeatureExtractor.nonmax(new ConfigExtract(2, 1, 0, true, false, true));
GeneralFeatureDetector<GrayF32, GrayF32> general = new GeneralFeatureDetector<>(intensity, nonmax);
general.setMaxFeatures(600);
DetectorInterestPointMulti detector = new GeneralToInterestMulti(general, 2, GrayF32.class, GrayF32.class);
DescribeRegionPoint describe = FactoryDescribeRegionPoint.surfFast(null, GrayF32.class);
DetectDescribeMulti detDescMulti = new DetectDescribeMultiFusion(detector, null, describe);
return FactoryVisualOdometry.stereoQuadPnP(1.5, 0.5, 200, Double.MAX_VALUE, 300, 50, detDescMulti, GrayF32.class);
}
Aggregations