Public Member Functions | |
HistogramOfGradients (bool normalize=true, Dims cellDims=Dims(8, 8), bool fixedCells=false, int numOrientations=9, bool signedOrient=false) | |
Constructor. | |
virtual HistogramOfGradients * | clone () |
virtual | ~HistogramOfGradients () |
Destructor. | |
virtual void | calculateGradient (const Image< float > &img, const Image< float > &img2, const Image< float > &img3, Image< float > &gradmag, Image< float > &gradang) |
Calculate the gradient of 1-3 chanels of images. | |
virtual std::vector< float > | createHistogramFromGradient (const Image< float > &gradmag, const Image< float > &gradang) |
Calculate histogram using a gradient. | |
virtual std::vector< float > | createHistogram (const Image< float > &img, const Image< float > &img2=Image< float >(), const Image< float > &img3=Image< float >()) |
Create histogram of max of gradient across 1-3 channels of an image. | |
virtual std::vector< float > | normalizeFeatureVector (FeatureVector featureVector) |
Normalize block using nearby blocks. | |
virtual void | addToBin (const float xf, const float yf, const float ang_in, const float mag, const bool oriSigned, FeatureVector &fv) |
Force angle to conform to oriSigned option and add to histogram. | |
Protected Attributes | |
bool | itsNormalize |
Whether to normalize columns in the histogram. | |
Dims | itsCellDims |
bool | itsFixedDims |
If true, fix the size of the histogram no matter the image size, if false, fix the size of the cell no matter the image size. | |
int | itsOriBins |
Number of bins to categorize orientations. | |
bool | itsOriSigned |
float | itsEpsilon |
Definition at line 52 of file HistogramOfGradients.H.
HistogramOfGradients::HistogramOfGradients | ( | bool | normalize = true , |
|
Dims | cellDims = Dims(8,8) , |
|||
bool | fixedCells = false , |
|||
int | numOrientations = 9 , |
|||
bool | signedOrient = false | |||
) |
Constructor.
Definition at line 49 of file HistogramOfGradients.C.
HistogramOfGradients::~HistogramOfGradients | ( | ) | [virtual] |
Destructor.
Definition at line 60 of file HistogramOfGradients.C.
void HistogramOfGradients::addToBin | ( | const float | xf, | |
const float | yf, | |||
const float | ang_in, | |||
const float | mag, | |||
const bool | oriSigned, | |||
FeatureVector & | fv | |||
) | [virtual] |
Force angle to conform to oriSigned option and add to histogram.
Definition at line 211 of file HistogramOfGradients.C.
References FeatureVector::addValue(), and FeatureVector::getZSize().
Referenced by JunctionHOG::calculateJunctionHistogram(), and createHistogramFromGradient().
void HistogramOfGradients::calculateGradient | ( | const Image< float > & | img, | |
const Image< float > & | img2, | |||
const Image< float > & | img3, | |||
Image< float > & | gradmag, | |||
Image< float > & | gradang | |||
) | [virtual] |
Calculate the gradient of 1-3 chanels of images.
Definition at line 72 of file HistogramOfGradients.C.
References gradientSobel(), Image< T >::initialized(), and takeLinkedMax().
Referenced by createHistogram().
std::vector< float > HistogramOfGradients::createHistogram | ( | const Image< float > & | img, | |
const Image< float > & | img2 = Image<float>() , |
|||
const Image< float > & | img3 = Image<float>() | |||
) | [virtual] |
Create histogram of max of gradient across 1-3 channels of an image.
Definition at line 64 of file HistogramOfGradients.C.
References calculateGradient(), and createHistogramFromGradient().
std::vector< float > HistogramOfGradients::createHistogramFromGradient | ( | const Image< float > & | gradmag, | |
const Image< float > & | gradang | |||
) | [virtual] |
Calculate histogram using a gradient.
Reimplemented in JunctionHOG.
Definition at line 97 of file HistogramOfGradients.C.
References addToBin(), Image< T >::coordsOk(), Image< T >::getHeight(), Image< T >::getValInterp(), Image< T >::getWidth(), Dims::h(), itsCellDims, itsFixedDims, itsNormalize, itsOriBins, normalizeFeatureVector(), and Dims::w().
Referenced by createHistogram().
std::vector< float > HistogramOfGradients::normalizeFeatureVector | ( | FeatureVector | featureVector | ) | [virtual] |
Normalize block using nearby blocks.
Definition at line 142 of file HistogramOfGradients.C.
References FeatureVector::getFeatureVector(), FeatureVector::getXSize(), FeatureVector::getYSize(), FeatureVector::getZSize(), and sqrt().
Referenced by JunctionHOG::calculateJunctionHistogram(), and createHistogramFromGradient().
Dims HistogramOfGradients::itsCellDims [protected] |
If fixed dims is true, itsCellDims is the number of cells in the histogram whose cell size depends on the input image If fixed dims is false, itsCellDims is the size of an individual cell, and the number of cells depends on the input image
Definition at line 88 of file HistogramOfGradients.H.
Referenced by JunctionHOG::calculateJunctionHistogram(), and createHistogramFromGradient().
bool HistogramOfGradients::itsFixedDims [protected] |
If true, fix the size of the histogram no matter the image size, if false, fix the size of the cell no matter the image size.
Definition at line 90 of file HistogramOfGradients.H.
Referenced by JunctionHOG::calculateJunctionHistogram(), and createHistogramFromGradient().
bool HistogramOfGradients::itsNormalize [protected] |
Whether to normalize columns in the histogram.
Definition at line 85 of file HistogramOfGradients.H.
Referenced by JunctionHOG::calculateJunctionHistogram(), and createHistogramFromGradient().
int HistogramOfGradients::itsOriBins [protected] |
Number of bins to categorize orientations.
Definition at line 92 of file HistogramOfGradients.H.
Referenced by createHistogramFromGradient().