Class HOGParameters

Object
org.anchoranalysis.bean.AnchorBean<HOGParameters>
org.anchoranalysis.plugin.opencv.bean.feature.HOGParameters

public class HOGParameters
extends org.anchoranalysis.bean.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()  
    HOGParameters​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
    Creates with a particular Interpolator.
  • Method Summary

    Modifier and Type Method Description
    protected boolean canEqual​(Object other)  
    void checkSize​(org.anchoranalysis.spatial.box.Extent extent)
    Throws an exception if an image of size extent cannot be described by these parameters.
    org.opencv.objdetect.HOGDescriptor createDescriptor​(org.anchoranalysis.spatial.box.Extent imageSize)
    Creates an empty HOGDescriptor to describe an image of a particular size.
    boolean equals​(Object o)  
    org.anchoranalysis.image.bean.spatial.SizeXY getBlockSize()
    The block-size as per OpenCV implementation (identical default-size).
    org.anchoranalysis.image.bean.spatial.SizeXY getBlockStride()
    The block-stride as per OpenCV implementation (identical default-size).
    org.anchoranalysis.image.bean.spatial.SizeXY getCellSize()
    The cell-size as per OpenCV implementation (identical default-size).
    org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()
    The interpolator to use for scaling images.
    int getNumberBins()
    The number of bins in each histogram for a cell.
    org.anchoranalysis.image.bean.spatial.SizeXY getWindowSize()
    The window-size as per OpenCV implementation.
    int hashCode()  
    void setBlockSize​(org.anchoranalysis.image.bean.spatial.SizeXY blockSize)
    The block-size as per OpenCV implementation (identical default-size).
    void setBlockStride​(org.anchoranalysis.image.bean.spatial.SizeXY blockStride)
    The block-stride as per OpenCV implementation (identical default-size).
    void setCellSize​(org.anchoranalysis.image.bean.spatial.SizeXY cellSize)
    The cell-size as per OpenCV implementation (identical default-size).
    void setInterpolator​(org.anchoranalysis.image.bean.interpolator.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​(org.anchoranalysis.image.bean.spatial.SizeXY windowSize)
    The window-size as per OpenCV implementation.
    int sizeDescriptor​(org.anchoranalysis.spatial.box.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​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
      Creates with a particular Interpolator.
      Parameters:
      interpolator - the interpolator.
    • HOGParameters

      public HOGParameters()
  • Method Details

    • sizeDescriptor

      public int sizeDescriptor​(org.anchoranalysis.spatial.box.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​(org.anchoranalysis.spatial.box.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​(org.anchoranalysis.spatial.box.Extent extent) throws org.anchoranalysis.feature.calculate.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:
      org.anchoranalysis.feature.calculate.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 org.anchoranalysis.image.bean.spatial.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​(org.anchoranalysis.image.bean.spatial.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 org.anchoranalysis.image.bean.spatial.SizeXY getBlockSize()
      The block-size as per OpenCV implementation (identical default-size).
    • setBlockSize

      public void setBlockSize​(org.anchoranalysis.image.bean.spatial.SizeXY blockSize)
      The block-size as per OpenCV implementation (identical default-size).
    • getBlockStride

      public org.anchoranalysis.image.bean.spatial.SizeXY getBlockStride()
      The block-stride as per OpenCV implementation (identical default-size).
    • setBlockStride

      public void setBlockStride​(org.anchoranalysis.image.bean.spatial.SizeXY blockStride)
      The block-stride as per OpenCV implementation (identical default-size).
    • getCellSize

      public org.anchoranalysis.image.bean.spatial.SizeXY getCellSize()
      The cell-size as per OpenCV implementation (identical default-size).
    • setCellSize

      public void setCellSize​(org.anchoranalysis.image.bean.spatial.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 org.anchoranalysis.image.bean.interpolator.Interpolator getInterpolator()
      The interpolator to use for scaling images.
    • setInterpolator

      public void setInterpolator​(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)
      The interpolator to use for scaling images.