Class OrientationSlidingWindow<D extends ImageGray<D>>

java.lang.Object
boofcv.alg.feature.orientation.OrientationSlidingWindow<D>
All Implemented Interfaces:
OrientationGradient<D>, RegionOrientation
Direct Known Subclasses:
ImplOrientationSlidingWindow_F32, ImplOrientationSlidingWindow_S16, ImplOrientationSlidingWindow_S32

public abstract class OrientationSlidingWindow<D extends ImageGray<D>>
extends Object
implements OrientationGradient<D>

Estimates the orientation by sliding window across all angles. All pixels which are pointing at an angle inside of this window have their gradient summed. The window with the largest normal is selected as the best window. The angle is then computed from the best window using atan2() and the summed gradient.

NOTE: There are probably additional performance enhancements that could be done.

  • Field Details

    • pixelRadius

      protected int pixelRadius
    • objRadius

      protected double objRadius
    • objectRadiusToScale

      protected double objectRadiusToScale
    • derivX

      protected D extends ImageGray<D> derivX
    • derivY

      protected D extends ImageGray<D> derivY
    • rect

      protected ImageRectangle rect
    • numAngles

      protected int numAngles
    • windowSize

      protected double windowSize
    • angles

      protected double[] angles
    • isWeighted

      protected boolean isWeighted
    • weights

      protected Kernel2D_F32 weights
  • Constructor Details

    • OrientationSlidingWindow

      protected OrientationSlidingWindow​(double objectRadiusToScale, int numAngles, double windowSize, boolean isWeighted)
      Configures orientation estimating algorithm.
      Parameters:
      objectRadiusToScale - Convert object radius into scale factor
      numAngles - Number of discrete points in which the sliding window will be centered around.
      windowSize - Number of radians in the window being considered.
      isWeighted - Should points be weighted using a Gaussian kernel.
  • Method Details

    • getWeights

      public Kernel2D_F32 getWeights()
    • setObjectRadius

      public void setObjectRadius​(double objRadius)
      Description copied from interface: RegionOrientation
      Specifies the circle's radius that the orientation should be
      Specified by:
      setObjectRadius in interface RegionOrientation
      Parameters:
      objRadius - Object's radius.
    • setImage

      public void setImage​(D derivX, D derivY)
      Description copied from interface: OrientationGradient
      Specifies input image data for estimating orientation.
      Specified by:
      setImage in interface OrientationGradient<D extends ImageGray<D>>
      Parameters:
      derivX - Image derivative along x-axis.
      derivY - Image derivative along y-axis.
    • compute

      public double compute​(double X, double Y)
      Description copied from interface: RegionOrientation
      Computes the orientation of a region about its center.
      Specified by:
      compute in interface RegionOrientation
      Parameters:
      X - Center of the region in image pixels.
      Y - Center of the region in image pixels.
      Returns:
      Orientation in radians. Angle zero points along x-axis and pi/2 along y-axis.
    • computeOrientation

      protected abstract double computeOrientation()
      Compute the angle without using the optional weights
    • computeWeightedOrientation

      protected abstract double computeWeightedOrientation​(int c_x, int c_y)
      Compute the angle using the weighting kernel.