public abstract class DescribeDenseHogAlg<Input extends boofcv.struct.image.ImageBase,Derivative extends boofcv.struct.image.ImageBase>
extends java.lang.Object
Implementation of the Histogram of Oriented Gradients (HOG) [1] dense feature descriptor. Several variants are described in the paper. The algorithm used here is the "R-HOG unsigned orientation" variant. The descriptor is computed from a regular grid of cells and an unsigned histogram is computed. Unsigned as in the angle is from 0 to 180 degrees instead of 0 to 360.
This is a (hopefully) faithful implementation to the algorithm described in the paper. The descriptors are computed with the following steps.TupleDesc_F64 in a row-major fashion and a weight is applied. The weight is specified for each cell
based on its distance from the block's center. Gaussian weight is used with a standard deviation of 0.5*block_width.
Note that blocks do overlap. See paper for details.
[1] Dalal, Navneet, and Bill Triggs. "Histograms of oriented gradients for human detection." Computer Vision and Pattern Recognition, 2005. CVPR 2005.
| Modifier and Type | Class and Description |
|---|---|
static class |
DescribeDenseHogAlg.Cell |
| Modifier and Type | Field and Description |
|---|---|
protected Derivative |
derivX |
protected Derivative |
derivY |
protected float |
pixelDX |
protected float |
pixelDY |
| Constructor and Description |
|---|
DescribeDenseHogAlg(int orientationBins,
int widthCell,
int widthBlock,
int stepBlock,
boofcv.struct.image.ImageType<Input> imageType)
Configures HOG descriptor computation
|
| Modifier and Type | Method and Description |
|---|---|
Derivative |
_getDerivX() |
Derivative |
_getDerivY() |
float |
_getPixelDX() |
float |
_getPixelDY() |
protected void |
computeCellWeights()
Computes the value of weights inside of a block
|
abstract void |
computeDerivative(int pixelIndex)
Computes and stores the gradient at the specified pixel.
|
TupleDesc_F64 |
createDescription() |
DescribeDenseHogAlg.Cell |
getCell(int row,
int col) |
int |
getCellCols() |
int |
getCellRows() |
org.ddogleg.struct.FastQueue<TupleDesc_F64> |
getDescriptions()
List of descriptors
|
void |
getDescriptorsInRegion(int pixelX0,
int pixelY0,
int pixelX1,
int pixelY1,
java.util.List<TupleDesc_F64> output)
Convenience function which returns a list of all the descriptors computed inside the specified region in the image
|
boofcv.struct.image.ImageType<Input> |
getImageType() |
org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> |
getLocations()
List of locations for each descriptor.
|
int |
getOrientationBins() |
int |
getRegionWidthPixel()
Returns the number of pixel's wide the square region is that a descriptor was computed from
|
int |
getStepBlock() |
int |
getWidthBlock() |
int |
getWidthCell() |
void |
process()
Computes the descriptor across the input image
|
void |
setInput(Input input)
Specifies input image.
|
void |
setStepBlock(int stepBlock) |
void |
setWidthCell(int widthCell) |
protected Derivative extends boofcv.struct.image.ImageBase derivX
protected Derivative extends boofcv.struct.image.ImageBase derivY
protected float pixelDX
protected float pixelDY
public DescribeDenseHogAlg(int orientationBins,
int widthCell,
int widthBlock,
int stepBlock,
boofcv.struct.image.ImageType<Input> imageType)
orientationBins - Number of bins in a cell's histogram. 9 recommendedwidthCell - Number of pixel's wide a cell is. 8 recommendedwidthBlock - Number of cells's wide a black is. 3 recommendedstepBlock - Number of cells which are skipped between each blockprotected void computeCellWeights()
public void setInput(Input input)
input - input imagepublic void process()
public void getDescriptorsInRegion(int pixelX0,
int pixelY0,
int pixelX1,
int pixelY1,
java.util.List<TupleDesc_F64> output)
pixelX0 - Pixel coordinate X-axis lower extentpixelY0 - Pixel coordinate Y-axis lower extentpixelX1 - Pixel coordinate X-axis upper extentpixelY1 - Pixel coordinate Y-axis upper extentoutput - List of descriptionspublic abstract void computeDerivative(int pixelIndex)
public org.ddogleg.struct.FastQueue<georegression.struct.point.Point2D_I32> getLocations()
public org.ddogleg.struct.FastQueue<TupleDesc_F64> getDescriptions()
public Derivative _getDerivX()
public Derivative _getDerivY()
public float _getPixelDX()
public float _getPixelDY()
public int getRegionWidthPixel()
public void setWidthCell(int widthCell)
public int getWidthCell()
public int getWidthBlock()
public int getStepBlock()
public int getOrientationBins()
public int getCellRows()
public int getCellCols()
public DescribeDenseHogAlg.Cell getCell(int row, int col)
public void setStepBlock(int stepBlock)
public boofcv.struct.image.ImageType<Input> getImageType()
public TupleDesc_F64 createDescription()