Class HOGParameters

Object
AnchorBean<HOGParameters>
HOGParameters

public class HOGParameters extends AnchorBean<HOGParameters>
Parameters for calculating a HOG Descriptor covering window-size, block-size etc.

This class should implement a meaningful Object.equals(Object) and hashCode() on its properties as it may be used a CalculationPart. The interpolator) is not considered.

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    HOGParameters(Interpolator interpolator)
    Creates with a particular Interpolator.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    void
    checkSize(Extent extent)
    Throws an exception if an image of size extent cannot be described by these parameters.
    org.opencv.objdetect.HOGDescriptor
    createDescriptor(Extent imageSize)
    Creates an empty HOGDescriptor to describe an image of a particular size.
    boolean
     
    SizeXY
    The block-size as per OpenCV implementation (identical default-size).
    SizeXY
    The block-stride as per OpenCV implementation (identical default-size).
    SizeXY
    The cell-size as per OpenCV implementation (identical default-size).
    Interpolator
    The interpolator to use for scaling images.
    int
    The number of bins in each histogram for a cell.
    SizeXY
    The window-size as per OpenCV implementation.
    int
     
    void
    setBlockSize(SizeXY blockSize)
    The block-size as per OpenCV implementation (identical default-size).
    void
    setBlockStride(SizeXY blockStride)
    The block-stride as per OpenCV implementation (identical default-size).
    void
    setCellSize(SizeXY cellSize)
    The cell-size as per OpenCV implementation (identical default-size).
    void
    setInterpolator(Interpolator interpolator)
    The interpolator to use for scaling images.
    void
    setNumberBins(int numberBins)
    The number of bins in each histogram for a cell.
    void
    setWindowSize(SizeXY windowSize)
    The window-size as per OpenCV implementation.
    int
    sizeDescriptor(Extent imageSize)
    Calculates the size of the descriptor will be for a given image.

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HOGParameters

      public HOGParameters(Interpolator interpolator)
      Creates with a particular Interpolator.
      Parameters:
      interpolator - the interpolator.
    • HOGParameters

      public HOGParameters()
  • Method Details

    • sizeDescriptor

      public int sizeDescriptor(Extent imageSize)
      Calculates the size of the descriptor will be for a given image.

      It assumes the window is equal to the image-size.

      Parameters:
      imageSize - the size of the image (and window).
      Returns:
      the size of the descriptor needed.
    • createDescriptor

      public org.opencv.objdetect.HOGDescriptor createDescriptor(Extent imageSize)
      Creates an empty HOGDescriptor to describe an image of a particular size.
      Parameters:
      imageSize - the size of the image.
      Returns:
      the descriptor, not yet computed with meaningful values.
    • checkSize

      public void checkSize(Extent extent) throws FeatureCalculationException
      Throws an exception if an image of size extent cannot be described by these parameters.
      Parameters:
      extent - the size of the image to check.
      Throws:
      FeatureCalculationException - if the image is inappropriately sized for these parameters.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getWindowSize

      public SizeXY getWindowSize()
      The window-size as per OpenCV implementation. If not specified, the window is set to be the same size as the (possibly resized) image.
    • setWindowSize

      public void setWindowSize(SizeXY windowSize)
      The window-size as per OpenCV implementation. If not specified, the window is set to be the same size as the (possibly resized) image.
    • getBlockSize

      public SizeXY getBlockSize()
      The block-size as per OpenCV implementation (identical default-size).
    • setBlockSize

      public void setBlockSize(SizeXY blockSize)
      The block-size as per OpenCV implementation (identical default-size).
    • getBlockStride

      public SizeXY getBlockStride()
      The block-stride as per OpenCV implementation (identical default-size).
    • setBlockStride

      public void setBlockStride(SizeXY blockStride)
      The block-stride as per OpenCV implementation (identical default-size).
    • getCellSize

      public SizeXY getCellSize()
      The cell-size as per OpenCV implementation (identical default-size).
    • setCellSize

      public void setCellSize(SizeXY cellSize)
      The cell-size as per OpenCV implementation (identical default-size).
    • getNumberBins

      public int getNumberBins()
      The number of bins in each histogram for a cell.
    • setNumberBins

      public void setNumberBins(int numberBins)
      The number of bins in each histogram for a cell.
    • getInterpolator

      public Interpolator getInterpolator()
      The interpolator to use for scaling images.
    • setInterpolator

      public void setInterpolator(Interpolator interpolator)
      The interpolator to use for scaling images.