Class 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
ConstructorsConstructorDescriptionHOGParameters
(Interpolator interpolator) Creates with a particularInterpolator
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
Throws an exception if an image of sizeextent
cannot be described by these parameters.org.opencv.objdetect.HOGDescriptor
createDescriptor
(Extent imageSize) Creates an emptyHOGDescriptor
to describe an image of a particular size.boolean
The block-size as per OpenCV implementation (identical default-size).The block-stride as per OpenCV implementation (identical default-size).The cell-size as per OpenCV implementation (identical default-size).The interpolator to use for scaling images.int
The number of bins in each histogram for a cell.The window-size as per OpenCV implementation.int
hashCode()
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
-
Constructor Details
-
HOGParameters
Creates with a particularInterpolator
.- Parameters:
interpolator
- the interpolator.
-
HOGParameters
public HOGParameters()
-
-
Method Details
-
sizeDescriptor
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
Creates an emptyHOGDescriptor
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
Throws an exception if an image of sizeextent
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
-
canEqual
-
hashCode
public int hashCode() -
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
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
The block-size as per OpenCV implementation (identical default-size). -
setBlockSize
The block-size as per OpenCV implementation (identical default-size). -
getBlockStride
The block-stride as per OpenCV implementation (identical default-size). -
setBlockStride
The block-stride as per OpenCV implementation (identical default-size). -
getCellSize
The cell-size as per OpenCV implementation (identical default-size). -
setCellSize
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
The interpolator to use for scaling images. -
setInterpolator
The interpolator to use for scaling images.
-