Direct Graphical Models  v.1.7.0
DirectGraphicalModels::fex::CHOG Class Reference

HOG (histogram of oriented gradients) feature extraction class. More...

#include <HOG.h>

Inheritance diagram for DirectGraphicalModels::fex::CHOG:
Collaboration diagram for DirectGraphicalModels::fex::CHOG:

Public Member Functions

 CHOG (const Mat &img)
 Constructor. More...
 
virtual ~CHOG (void)
 
virtual Mat get (void) const
 Extracts and returns the required feature. More...
 
- Public Member Functions inherited from DirectGraphicalModels::fex::ILocalFeatureExtractor
 ILocalFeatureExtractor (const Mat &img)
 Constructor. More...
 
virtual ~ILocalFeatureExtractor (void)
 
- Public Member Functions inherited from DirectGraphicalModels::fex::IFeatureExtractor
 IFeatureExtractor (const Mat &img)
 Constructor. More...
 
virtual ~IFeatureExtractor (void)
 

Static Public Member Functions

static Mat get (const Mat &img, int nBins=9, SqNeighbourhood nbhd=sqNeighbourhood(5))
 Extracts the HOG feature. More...
 

Additional Inherited Members

- Protected Attributes inherited from DirectGraphicalModels::fex::IFeatureExtractor
const Mat m_img
 Container for the image, from which the features are to be extracted. More...
 

Detailed Description

HOG (histogram of oriented gradients) feature extraction class.

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 15 of file HOG.h.

Constructor & Destructor Documentation

◆ CHOG()

DirectGraphicalModels::fex::CHOG::CHOG ( const Mat &  img)
inline

Constructor.

Parameters
imgInput image of type CV_8UC1 or CV_8UC3.

Definition at line 22 of file HOG.h.

◆ ~CHOG()

virtual DirectGraphicalModels::fex::CHOG::~CHOG ( void  )
inlinevirtual

Definition at line 23 of file HOG.h.

Member Function Documentation

◆ get() [1/2]

virtual Mat DirectGraphicalModels::fex::CHOG::get ( void  ) const
inlinevirtual

Extracts and returns the required feature.

Returns
The feature image.

Implements DirectGraphicalModels::fex::ILocalFeatureExtractor.

Definition at line 25 of file HOG.h.

Here is the caller graph for this function:

◆ get() [2/2]

Mat DirectGraphicalModels::fex::CHOG::get ( const Mat &  img,
int  nBins = 9,
SqNeighbourhood  nbhd = sqNeighbourhood(5) 
)
static

Extracts the HOG feature.

For each pixel of the source image this function calculates the histogram of oriented gradients inside the pixel's neighbourhood nbhd. The histogram consists of nBins values, it is normalized, and stored as nBins channel image, thus, the channel index corresponds to the histogram index.

Parameters
imgInput image of type CV_8UC1 or CV_8UC3.
nBinsNumber of bins. Hence a single bin covers an angle of \(\frac{180^\circ}{nBins}\).
nbhdNeighborhood around the pixel, where its histogram is estimated. (Ref. SqNeighbourhood).
Returns
The HOG feature image of type CV_8UC{n}, where \(n=nBins\).

Definition at line 7 of file HOG.cpp.

Here is the call graph for this function:

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