Class SurfDescribeOps

java.lang.Object
boofcv.alg.feature.describe.SurfDescribeOps

public class SurfDescribeOps
extends Object
Operations related to computing SURF descriptors.
  • Constructor Summary

    Constructors
    Constructor Description
    SurfDescribeOps()  
  • Method Summary

    Modifier and Type Method Description
    static <T extends ImageGray<T>>
    SparseScaleGradient<T,​?>
    createGradient​(boolean useHaar, Class<T> imageType)
    Creates a class for computing the image gradient from an integral image in a sparse fashion.
    static <T extends ImageGray<T>>
    void
    gradient​(T ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, boolean useHaar, double[] derivX, double[] derivY)
    Computes the of a square region.
    static void gradient_noborder​(GrayF32 ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, float[] derivX, float[] derivY)
    Faster version of gradient(T, double, double, double, int, double, boolean, double[], double[]) which assumes the region is entirely contained inside the of the image.
    static void gradient_noborder​(GrayS32 ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, int[] derivX, int[] derivY)
    Faster version of gradient(T, double, double, double, int, double, boolean, double[], double[]) which assumes the region is entirely contained inside the of the image.
    static boolean isInside​(int width, int height, double tl_x, double tl_y, double regionSize, double sampleSize)
    Tests to see if the rectangular region being sampled is contained inside the image.
    static <T extends ImageGray<T>>
    boolean
    isInside​(T ii, double X, double Y, int radiusRegions, double kernelSize, double scale, double c, double s)
    Checks to see if the region is contained inside the image.
    static double rotatedWidth​(double width, double c, double s)
    Computes the width of a square containment region that contains a rotated rectangle.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SurfDescribeOps

      public SurfDescribeOps()
  • Method Details

    • gradient

      public static <T extends ImageGray<T>> void gradient​(T ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, boolean useHaar, double[] derivX, double[] derivY)

      Computes the of a square region. The region considered has a radius of ceil(radius*s) pixels. The derivative is computed every 's' pixels.

      Deviation from paper:

      • An symmetric box derivative is used instead of the Haar wavelet.

      Parameters:
      tl_x - Top left corner.
      tl_y - Top left corner.
      samplePeriod - Distance between sample points (in pixels)
      regionSize - Width of region being considered in samples points (not pixels).
      kernelWidth - Size of the kernel's width (in pixels) .
      derivX - Derivative x wavelet output. length = radiusRegions*radiusRegions
      derivY - Derivative y wavelet output. length = radiusRegions*radiusRegions
    • gradient_noborder

      public static void gradient_noborder​(GrayF32 ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, float[] derivX, float[] derivY)
      Faster version of gradient(T, double, double, double, int, double, boolean, double[], double[]) which assumes the region is entirely contained inside the of the image. This includes the convolution kernel's radius.
    • gradient_noborder

      public static void gradient_noborder​(GrayS32 ii, double tl_x, double tl_y, double samplePeriod, int regionSize, double kernelWidth, int[] derivX, int[] derivY)
      Faster version of gradient(T, double, double, double, int, double, boolean, double[], double[]) which assumes the region is entirely contained inside the of the image. This includes the convolution kernel's radius.
    • createGradient

      public static <T extends ImageGray<T>> SparseScaleGradient<T,​?> createGradient​(boolean useHaar, Class<T> imageType)
      Creates a class for computing the image gradient from an integral image in a sparse fashion. All these kernels assume that the kernel is entirely contained inside the image!
      Parameters:
      useHaar - Should it use a haar wavelet or an derivative kernel.
      imageType - Type of image being processed.
      Returns:
      Sparse gradient algorithm
    • isInside

      public static <T extends ImageGray<T>> boolean isInside​(T ii, double X, double Y, int radiusRegions, double kernelSize, double scale, double c, double s)
      Checks to see if the region is contained inside the image. This includes convolution kernel. Take in account the orientation of the region.
      Parameters:
      X - Center of the interest point.
      Y - Center of the interest point.
      radiusRegions - Radius in pixels of the whole region at a scale of 1
      kernelSize - Size of the kernel in pixels at a scale of 1
      scale - Scale factor for the region.
      c - Cosine of the orientation
      s - Sine of the orientation
    • isInside

      public static boolean isInside​(int width, int height, double tl_x, double tl_y, double regionSize, double sampleSize)

      Tests to see if the rectangular region being sampled is contained inside the image. Sampling is done using a square region with the specified size, where size corresponds to the length of each side. The sample region's size is discretized and rounded up, making this a conservative estimate for containment.

      This takes in account how integral images are read. To read in a rectangular region the pixel below the lower left corner is read, which results in an extra minus along enough axis for the lower bound. It is also assumed that points are discretized by rounding.

      Parameters:
      width - Image's width.
      height - Image's height.
      tl_x - Top left corner of region being sampled.
      tl_y - Top left corner of region being sampled.
      regionSize - Size of the region being sampled.
      sampleSize - Length of each side in the sample region. See comment above.
      Returns:
      If all samples are contained inside the image.
    • rotatedWidth

      public static double rotatedWidth​(double width, double c, double s)
      Computes the width of a square containment region that contains a rotated rectangle.
      Parameters:
      width - Size of the original rectangle.
      c - Cosine(theta)
      s - Sine(theta)
      Returns:
      Side length of the containment square.