Class DescribeSiftCommon

Direct Known Subclasses:
DescribeDenseSiftAlg, DescribePointSift

public class DescribeSiftCommon extends Object
Base class for SIFT descriptors. Provides common functionality between sparse and dense computations.
  • 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.
      widthSubregion - Width of sub-region in samples. Try 4
      widthGrid - Width of grid in subregions. Try 4.
      numHistogramBins - Number of bins in histogram. Try 8
      weightingSigmaFraction - Sigma for Gaussian weighting function is set to this value * region width. Try 0.5
      maxDescriptorElementValue - Helps with non-affine changes in lighting. See paper. Try 0.2
  • Method Details

    • normalizeDescriptor

      public static void normalizeDescriptor(TupleDesc_F64 descriptor, double maxDescriptorElementValue)
      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