22 typedef enum _drwnHOGNormalization {
26 } drwnHOGNormalization;
66 inline cv::Size
numCells(
const cv::Size& imgSize)
const;
68 inline cv::Size
numBlocks(
const cv::Size& imgSize)
const;
70 inline cv::Size
padImageSize(
const cv::Size& imgSize)
const;
77 void computeFeatures(
const cv::Mat& img, std::vector<cv::Mat>& features);
80 void computeFeatures(
const pair<cv::Mat, cv::Mat>& gradMagAndOri, std::vector<cv::Mat>& features);
90 void computeCanonicalOrientations(vector<float>& x, vector<float>& y)
const;
91 void computeCellHistograms(
const pair<cv::Mat, cv::Mat>& gradMagAndOri, vector<cv::Mat>& cellHistorgams)
const;
92 void computeBlockFeatures(
const vector<cv::Mat>& cellHistograms, vector<cv::Mat>& features)
const;
93 void normalizeFeatureVectors(std::vector<cv::Mat>& features)
const;
94 void clipFeatureVectors(std::vector<cv::Mat>& features)
const;
113 cv::Size nCells =
numCells(imgSize);
120 (
int)((imgSize.height + _cellSize - 1) / _cellSize) * _cellSize);
static int DEFAULT_ORIENTATIONS
default number of quantized orientations
Definition: drwnHOGFeatures.h:44
int numFeatures() const
returns the number of features (numBlocks times _numOrientations)
Definition: drwnHOGFeatures.h:99
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 ...
Definition: drwnHOGFeatures.cpp:96
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 o...
Definition: drwnHOGFeatures.cpp:172
cv::Size padImageSize(const cv::Size &imgSize) const
returns the size of the padded (enlarged) image over which features are computed
Definition: drwnHOGFeatures.h:117
static double DEFAULT_CLIPPING_UB
default upper-bound clipping in (0, 1]
Definition: drwnHOGFeatures.h:47
int _cellSize
size of each cell in pixels
Definition: drwnHOGFeatures.h:51
pair< cv::Mat, cv::Mat > gradientMagnitudeAndOrientation(const cv::Mat &img) const
pre-process gradient magnitude and orientation (can be provided to computeFeatures) ...
Definition: drwnHOGFeatures.cpp:52
static drwnHOGNormalization DEFAULT_NORMALIZATION
default normalization method
Definition: drwnHOGFeatures.h:45
cv::Size numBlocks(const cv::Size &imgSize) const
returns the size of the feature maps in terms of blocks
Definition: drwnHOGFeatures.h:111
cv::Size numCells(const cv::Size &imgSize) const
returns the size of the feature maps in terms of cells
Definition: drwnHOGFeatures.h:105
int _numOrientations
number of orientations in histogram
Definition: drwnHOGFeatures.h:54
static int DEFAULT_CELL_SIZE
default cell size (in pixels)
Definition: drwnHOGFeatures.h:41
static bool DEFAULT_DIM_REDUCTION
true for analytic dimensionality reduction
Definition: drwnHOGFeatures.h:48
bool _bDimReduction
use dimensionality reduction trick of Felzenszwalb et al, PAMI 2010
Definition: drwnHOGFeatures.h:57
Encapsulates histogram-of-gradient (HOG) feature computation.
Definition: drwnHOGFeatures.h:39
int _blockSize
number of cells in a block
Definition: drwnHOGFeatures.h:52
static int DEFAULT_BLOCK_STEP
default block increment (in cells)
Definition: drwnHOGFeatures.h:43
pair< double, double > _clipping
clipping for renormalization (0.0, 1.0 means none)
Definition: drwnHOGFeatures.h:56
static int DEFAULT_BLOCK_SIZE
default block size (in cells)
Definition: drwnHOGFeatures.h:42
cv::Mat visualizeCells(const cv::Mat &img, int scale=2)
visualization
Definition: drwnHOGFeatures.cpp:229
drwnHOGNormalization _normalization
normalization method
Definition: drwnHOGFeatures.h:55
int _blockStep
step to next block in cells
Definition: drwnHOGFeatures.h:53
static double DEFAULT_CLIPPING_LB
default lower-bound clipping in [0, 1)
Definition: drwnHOGFeatures.h:46