Package boofcv.alg.feature.describe
Class DescribeSiftCommon
java.lang.Object
boofcv.alg.feature.describe.DescribeSiftCommon
- Direct Known Subclasses:
DescribeDenseSiftAlg
,DescribePointSift
Base class for
SIFT
descriptors. Provides common functionality between sparse and
dense computations.-
Field Summary
Modifier and TypeFieldDescriptionprotected float[]
protected double
protected double
protected int
protected int
protected int
-
Constructor Summary
ConstructorDescriptionDescribeSiftCommon
(int widthSubregion, int widthGrid, int numHistogramBins, double weightingSigmaFraction, double maxDescriptorElementValue) Configures the descriptor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static float[]
createGaussianWeightKernel
(double sigma, int radius) Creates a gaussian weighting kernel with an even number of elements along its widthint
Radius of descriptor in pixels.int
Number of elements in the descriptor.static void
normalizeDescriptor
(TupleDesc_F64 descriptor, double maxDescriptorElementValue) Adjusts the descriptor.protected void
trilinearInterpolation
(float weight, float sampleX, float sampleY, double angle, TupleDesc_F64 descriptor) Applies trilinear interpolation across the descriptor
-
Field Details
-
widthSubregion
protected int widthSubregion -
widthGrid
protected int widthGrid -
numHistogramBins
protected int numHistogramBins -
histogramBinWidth
protected double histogramBinWidth -
maxDescriptorElementValue
protected double maxDescriptorElementValue -
gaussianWeight
protected float[] gaussianWeight
-
-
Constructor Details
-
DescribeSiftCommon
public DescribeSiftCommon(int widthSubregion, int widthGrid, int numHistogramBins, double weightingSigmaFraction, double maxDescriptorElementValue) Configures the descriptor.- Parameters:
widthSubregion
- Width of sub-region in samples. Try 4widthGrid
- Width of grid in subregions. Try 4.numHistogramBins
- Number of bins in histogram. Try 8weightingSigmaFraction
- Sigma for Gaussian weighting function is set to this value * region width. Try 0.5maxDescriptorElementValue
- Helps with non-affine changes in lighting. See paper. Try 0.2
-
-
Method Details
-
normalizeDescriptor
Adjusts the descriptor. This adds lighting invariance and reduces the affects of none-affine changes in lighting. 1) Apply L2 normalization 2) Clip using max descriptor value 3) Apply L2 normalization again -
createGaussianWeightKernel
protected static float[] createGaussianWeightKernel(double sigma, int radius) Creates a gaussian weighting kernel with an even number of elements along its width -
trilinearInterpolation
protected void trilinearInterpolation(float weight, float sampleX, float sampleY, double angle, TupleDesc_F64 descriptor) Applies trilinear interpolation across the descriptor -
getDescriptorLength
public int getDescriptorLength()Number of elements in the descriptor. -
getCanonicalRadius
public int getCanonicalRadius()Radius of descriptor in pixels. Width is radius*2
-