LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::loweGradientFeature Class Reference

Local feature based on the gradient distribution at the level of the location. More...

#include <ltiLoweGradientFeature.h>

Inheritance diagram for lti::loweGradientFeature:
Inheritance graph
[legend]
Collaboration diagram for lti::loweGradientFeature:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class loweGradientFeature. More...

Public Member Functions

 loweGradientFeature ()
 loweGradientFeature (const parameters &par)
 loweGradientFeature (const loweGradientFeature &other)
virtual ~loweGradientFeature ()
virtual const char * getTypeName () const
loweGradientFeaturecopy (const loweGradientFeature &other)
loweGradientFeatureoperator= (const loweGradientFeature &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool updateParameters ()
bool apply (const channel &src, const std::list< location > &locs, std::list< dvector > &vcts)
bool apply (const image &src, const std::list< location > &locs, std::list< dvector > &vcts)
bool apply (const std::list< location > &locs, std::list< dvector > &vcts)
bool apply (const location &locs, dvector &dest)
bool generate (const image &src)
bool generate (const channel &src)
Debug methods.



const imatrixgetHistogramMask () const
const matrix< float > & getWeightMask () const
const scaleSpacePyramid
< channel > & 
getMagnitudePyramid () const
const scaleSpacePyramid
< channel > & 
getAnglePyramid () const

Protected Member Functions

bool computeHistograms (const int level, const tpoint< float > &pos, const float angle, matrix< double > &hists) const

Protected Attributes

scaleSpacePyramid< channelpyrMag

LUT and Masks



matrix< int > hmask
matrix< float > weight
tpoint< float > maskCenter
int numHistograms
matrix< int > ioPts
bool initMasks ()

Detailed Description

Local feature based on the gradient distribution at the level of the location.

This local descriptor based was developed by David Lowe (see his paper "Distinctive Image Features from Scale-Invariant Keypoints", 2003).

Lowe proposed also proposed 1999 a similar local descriptor called "SIFT", but he changed it in his later work to used the information of one resolution only.

It computes histograms of the gradient orientation for several parts of the region delimited by a location, where the weights of each sample are determined by the magnitude of the gradient and the distance to the center of the location.

The location is divided in each axis by a given integer number h (parameters::numHistograms). This results in a total of h x h histograms and each one of them will have n x n samples, where n represents parameters::sampleRegionSize.

It can compute features for monochrome images and for color images, where the color feature is just the concatenation of the three monochromatic RGB ones.


Constructor & Destructor Documentation

lti::loweGradientFeature::loweGradientFeature (  ) 

Default constructor.

lti::loweGradientFeature::loweGradientFeature ( const parameters par  ) 

Construct a functor using the given parameters.

lti::loweGradientFeature::loweGradientFeature ( const loweGradientFeature other  ) 

Copy constructor.

Parameters:
other the object to be copied
virtual lti::loweGradientFeature::~loweGradientFeature (  )  [virtual]

Destructor.


Member Function Documentation

bool lti::loweGradientFeature::apply ( const location locs,
dvector dest 
)

Compute the gradient feature for the given location.

You must call first the method generate() to indicate which image needs to be analyzed. (Otherwise it would take too much time if you need to extract several features from the same image, and the pyramid would have to be generated each time!)

Parameters:
locs location that need to be analyzed.
dest feature vector.
Returns:
true if successful, or false otherwise.
bool lti::loweGradientFeature::apply ( const std::list< location > &  locs,
std::list< dvector > &  vcts 
)

Extract features based on a previously generated pyramid set.

The decision if you want color or gray features is taken at the time of the pyramid generation.

See also:
generate()
bool lti::loweGradientFeature::apply ( const image src,
const std::list< location > &  locs,
std::list< dvector > &  vcts 
)

Extracts the color features at the loctions.

bool lti::loweGradientFeature::apply ( const channel src,
const std::list< location > &  locs,
std::list< dvector > &  vcts 
)

Extracts gradient features at the locations for a gray-valued input channel.

virtual functor* lti::loweGradientFeature::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Reimplemented from lti::featureExtractor.

bool lti::loweGradientFeature::computeHistograms ( const int  level,
const tpoint< float > &  pos,
const float  angle,
matrix< double > &  hists 
) const [protected]

Compute the histogram for a given location.

loweGradientFeature& lti::loweGradientFeature::copy ( const loweGradientFeature other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::featureExtractor.

bool lti::loweGradientFeature::generate ( const channel src  ) 

Generate and internal pyramidal representation for the given gray valued channel, which can be later analyzed with the respective apply method.

bool lti::loweGradientFeature::generate ( const image src  ) 

Generate and internal pyramidal representation for the given color image, which can be later analyzed with the respective apply method.

const scaleSpacePyramid<channel>& lti::loweGradientFeature::getAnglePyramid (  )  const

Return the gradient orientation pyramid.

const imatrix& lti::loweGradientFeature::getHistogramMask (  )  const

Return read-only reference to the histogram mask.

const scaleSpacePyramid<channel>& lti::loweGradientFeature::getMagnitudePyramid (  )  const

Return the gradient magnitude pyramid.

const parameters& lti::loweGradientFeature::getParameters (  )  const

Returns used parameters.

Reimplemented from lti::featureExtractor.

virtual const char* lti::loweGradientFeature::getTypeName (  )  const [virtual]

Returns the name of this type ("loweGradientFeature").

Reimplemented from lti::featureExtractor.

const matrix<float>& lti::loweGradientFeature::getWeightMask (  )  const

Return the weight mask.

bool lti::loweGradientFeature::initMasks (  )  [protected]

Initialize LUT and masks used to accelerate feature computation.

loweGradientFeature& lti::loweGradientFeature::operator= ( const loweGradientFeature other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

virtual bool lti::loweGradientFeature::updateParameters (  )  [virtual]

Update parameters.

Reimplemented from lti::functor.


Member Data Documentation

Mask contains the index of the corresponding histogram for each entry.

Input/output points.

The size of this "matrix" will always be the 2 x number of rows of the mask, but indexed also with negative values.

The row 0 contains the in points and the row 1 the out points.

Position of the location center in the mask.

Total number of histograms computer per location.

the pyramids

Mask contains the weight for each entry in the histogram.


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

Generated on Sat Apr 10 15:27:33 2010 for LTI-Lib by Doxygen 1.6.1