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 particularInterpolator. -
Method Summary
Modifier and Type Method Description protected booleancanEqual(Object other)voidcheckSize(org.anchoranalysis.spatial.box.Extent extent)Throws an exception if an image of sizeextentcannot be described by these parameters.org.opencv.objdetect.HOGDescriptorcreateDescriptor(org.anchoranalysis.spatial.box.Extent imageSize)Creates an emptyHOGDescriptorto describe an image of a particular size.booleanequals(Object o)org.anchoranalysis.image.bean.spatial.SizeXYgetBlockSize()The block-size as per OpenCV implementation (identical default-size).org.anchoranalysis.image.bean.spatial.SizeXYgetBlockStride()The block-stride as per OpenCV implementation (identical default-size).org.anchoranalysis.image.bean.spatial.SizeXYgetCellSize()The cell-size as per OpenCV implementation (identical default-size).org.anchoranalysis.image.bean.interpolator.InterpolatorgetInterpolator()The interpolator to use for scaling images.intgetNumberBins()The number of bins in each histogram for a cell.org.anchoranalysis.image.bean.spatial.SizeXYgetWindowSize()The window-size as per OpenCV implementation.inthashCode()voidsetBlockSize(org.anchoranalysis.image.bean.spatial.SizeXY blockSize)The block-size as per OpenCV implementation (identical default-size).voidsetBlockStride(org.anchoranalysis.image.bean.spatial.SizeXY blockStride)The block-stride as per OpenCV implementation (identical default-size).voidsetCellSize(org.anchoranalysis.image.bean.spatial.SizeXY cellSize)The cell-size as per OpenCV implementation (identical default-size).voidsetInterpolator(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)The interpolator to use for scaling images.voidsetNumberBins(int numberBins)The number of bins in each histogram for a cell.voidsetWindowSize(org.anchoranalysis.image.bean.spatial.SizeXY windowSize)The window-size as per OpenCV implementation.intsizeDescriptor(org.anchoranalysis.spatial.box.Extent imageSize)Calculates the size of the descriptor will be for a given image.
-
Constructor Details
-
HOGParameters
public HOGParameters(org.anchoranalysis.image.bean.interpolator.Interpolator interpolator)Creates with a particularInterpolator.- 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 emptyHOGDescriptorto 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.FeatureCalculationExceptionThrows an exception if an image of sizeextentcannot 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
-
canEqual
-
hashCode
public int hashCode() -
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.
-