Class SiftDescriptor

java.lang.Object
imagingbook.common.sift.SiftDescriptor
All Implemented Interfaces:
Pnt2d, Primitive2d, ShapeProducer, Comparable<SiftDescriptor>

public class SiftDescriptor extends Object implements Pnt2d, Comparable<SiftDescriptor>

This class defines a SIFT descriptor. See Sec. 25.3 of [1] for more details. Instances are immutable.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/20
  • Method Details

    • getX

      public double getX()
      Description copied from interface: Pnt2d
      Returns the x-coordinate of this point.
      Specified by:
      getX in interface Pnt2d
      Returns:
      the x-coordinate value
    • getY

      public double getY()
      Description copied from interface: Pnt2d
      Returns the y-coordinate of this point.
      Specified by:
      getY in interface Pnt2d
      Returns:
      the y-coordinate value
    • getScale

      public double getScale()
      Returns this descriptor's absolute scale (σ).
      Returns:
      the absolute scale
    • getScaleLevel

      public int getScaleLevel()
      Returns this descriptor's scale level (scale space octave index p).
      Returns:
      the scale level
    • getMagnitude

      public double getMagnitude()
      Returns this descriptor's gradient response magnitude (score).
      Returns:
      the gradient response magnitude
    • getOrientation

      public double getOrientation()
      Returns this descriptor's orientation angle (in radians).
      Returns:
      the orientation angle
    • getFeatures

      public int[] getFeatures()
      Returns this descriptor's feature vector (array of integers).
      Returns:
      the feature vector
    • getDistance

      public double getDistance(SiftDescriptor other)
      Calculates and returns the distance between this descriptor's feature vector and another descriptor's feature vector using the Euclidean distance (VectorNorm.L2).
      Parameters:
      other - another SiftDescriptor
      Returns:
      the distance
    • getDistance

      public double getDistance(SiftDescriptor other, VectorNorm norm)
      Calculates and returns the distance between this descriptor's feature vector and another descriptor's feature vector using the specified VectorNorm.
      Parameters:
      other - another SiftDescriptor
      norm - a VectorNorm instance
      Returns:
      the distance
    • getShape

      public Shape getShape(double featureScale)
      Description copied from interface: Pnt2d
      Returns a round dot (Shape instance) for drawing this point.
      Specified by:
      getShape in interface Pnt2d
      Specified by:
      getShape in interface ShapeProducer
      Parameters:
      featureScale - the dot radius
      Returns:
      the shape
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(SiftDescriptor other)
      Specified by:
      compareTo in interface Comparable<SiftDescriptor>