Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
drwnHOGFeatures Class Reference

Encapsulates histogram-of-gradient (HOG) feature computation. More...

Public Member Functions

int numFeatures () const
 returns the number of features (numBlocks times _numOrientations)
cv::Size numCells (const cv::Size &imgSize) const
 returns the size of the feature maps in terms of cells
cv::Size numBlocks (const cv::Size &imgSize) const
 returns the size of the feature maps in terms of blocks
cv::Size padImageSize (const cv::Size &imgSize) const
 returns the size of the padded (enlarged) image over which features are computed
pair< cv::Mat, cv::Mat > gradientMagnitudeAndOrientation (const cv::Mat &img) const
 pre-process gradient magnitude and orientation (can be provided to computeFeatures)
void computeFeatures (const cv::Mat &img, std::vector< cv::Mat > &features)
 feature calculation from greyscale image returns features as a vector of matrices of size numBlocks
void computeFeatures (const pair< cv::Mat, cv::Mat > &gradMagAndOri, std::vector< cv::Mat > &features)
 features calculation from gradient magnitude and orientation (returned by gradientMagnitudeAndOrientation)
void computeDenseFeatures (const cv::Mat &img, std::vector< cv::Mat > &features)
 compute features at each pixel location returns features as a vector of images the same size as the original image
cv::Mat visualizeCells (const cv::Mat &img, int scale=2)

Static Public Attributes

static int DEFAULT_CELL_SIZE = 8
 default cell size (in pixels)
static int DEFAULT_BLOCK_SIZE = 2
 default block size (in cells)
static int DEFAULT_BLOCK_STEP = 1
 default block increment (in cells)
 default number of quantized orientations
 default normalization method
static double DEFAULT_CLIPPING_LB = 0.1
 default lower-bound clipping in [0, 1)
static double DEFAULT_CLIPPING_UB = 0.5
 default upper-bound clipping in (0, 1]
static bool DEFAULT_DIM_REDUCTION = false
 true for analytic dimensionality reduction

Protected Member Functions

void computeCanonicalOrientations (vector< float > &x, vector< float > &y) const
void computeCellHistograms (const pair< cv::Mat, cv::Mat > &gradMagAndOri, vector< cv::Mat > &cellHistorgams) const
void computeBlockFeatures (const vector< cv::Mat > &cellHistograms, vector< cv::Mat > &features) const
void normalizeFeatureVectors (std::vector< cv::Mat > &features) const
void clipFeatureVectors (std::vector< cv::Mat > &features) const

Protected Attributes

int _cellSize
 size of each cell in pixels
int _blockSize
 number of cells in a block
int _blockStep
 step to next block in cells
int _numOrientations
 number of orientations in histogram
drwnHOGNormalization _normalization
 normalization method
pair< double, double > _clipping
 clipping for renormalization (0.0, 1.0 means none)
bool _bDimReduction
 use dimensionality reduction trick of Felzenszwalb et al, PAMI 2010

Detailed Description

Encapsulates histogram-of-gradient (HOG) feature computation.

The HOG features are described in:

The class can also be used for dense feature HOG calculation.

The documentation for this class was generated from the following files: