use of boofcv.abst.feature.describe.ConfigSiftDescribe in project BoofCV by lessthanoptimal.
the class FactoryDescribeImageDense method sift.
/**
* Creates a dense SIFT descriptor.
*
* @see DescribeDenseSiftAlg
*
* @param config Configuration for SIFT descriptor. null for defaults.
* @param imageType Type of input image
* @return Dense SIFT
*/
public static <T extends ImageGray<T>> DescribeImageDense<T, TupleDesc_F64> sift(@Nullable ConfigDenseSift config, Class<T> imageType) {
if (config == null)
config = new ConfigDenseSift();
config.checkValidity();
ConfigSiftDescribe c = config.sift;
Class derivType = GImageDerivativeOps.getDerivativeType(imageType);
DescribeDenseSiftAlg alg = new DescribeDenseSiftAlg(c.widthSubregion, c.widthGrid, c.numHistogramBins, c.weightingSigmaFraction, c.maxDescriptorElementValue, 1, 1, derivType);
return new DescribeImageDenseSift(alg, config.sampling.periodX, config.sampling.periodY, imageType);
}
use of boofcv.abst.feature.describe.ConfigSiftDescribe in project BoofCV by lessthanoptimal.
the class FactoryDetectDescribe method sift.
/**
* Creates a new SIFT feature detector and describer.
*
* @see CompleteSift
*
* @param config Configuration for the SIFT detector and descriptor.
* @return SIFT
*/
public static <T extends ImageGray<T>> DetectDescribePoint<T, BrightFeature> sift(@Nullable ConfigCompleteSift config) {
if (config == null)
config = new ConfigCompleteSift();
ConfigSiftScaleSpace configSS = config.scaleSpace;
ConfigSiftDetector configDetector = config.detector;
ConfigSiftOrientation configOri = config.orientation;
ConfigSiftDescribe configDesc = config.describe;
SiftScaleSpace scaleSpace = new SiftScaleSpace(configSS.firstOctave, configSS.lastOctave, configSS.numScales, configSS.sigma0);
OrientationHistogramSift<GrayF32> orientation = new OrientationHistogramSift<>(configOri.histogramSize, configOri.sigmaEnlarge, GrayF32.class);
DescribePointSift<GrayF32> describe = new DescribePointSift<>(configDesc.widthSubregion, configDesc.widthGrid, configDesc.numHistogramBins, configDesc.sigmaToPixels, configDesc.weightingSigmaFraction, configDesc.maxDescriptorElementValue, GrayF32.class);
NonMaxSuppression nns = FactoryFeatureExtractor.nonmax(configDetector.extract);
NonMaxLimiter nonMax = new NonMaxLimiter(nns, configDetector.maxFeaturesPerScale);
CompleteSift dds = new CompleteSift(scaleSpace, configDetector.edgeR, nonMax, orientation, describe);
return new DetectDescribe_CompleteSift<>(dds);
}
Aggregations