latest version v1.9 - last update 10 Apr 2010 |
Search for salient locations in the scale space of a channel. More...
#include <ltiPyramidLocationSearch.h>
Classes | |
class | parameters |
The parameters for the class pyramidLocationSearch. More... | |
Public Member Functions | |
pyramidLocationSearch () | |
pyramidLocationSearch (const parameters &par) | |
pyramidLocationSearch (const pyramidLocationSearch &other) | |
virtual | ~pyramidLocationSearch () |
virtual const char * | getTypeName () const |
pyramidLocationSearch & | copy (const pyramidLocationSearch &other) |
pyramidLocationSearch & | operator= (const pyramidLocationSearch &other) |
virtual functor * | clone () const |
const pyramidLocationSearch::parameters & | getParameters () const |
Apply methods | |
bool | apply (const channel &src, std::list< location > &locs) |
bool | apply (const channel &src, std::list< location > &locs, int &totalLocs) |
bool | apply (const channel &src, std::map< int, std::list< location > > &locs) |
bool | apply (const channel &src, std::map< int, std::list< location > > &locs, int &totalLocs) |
bool | apply (const channel &c1, const channel &c2, std::list< location > &locs) |
bool | apply (const channel &c1, const channel &c2, std::list< location > &locs, int &totalLocs) |
bool | apply (const channel &c1, const channel &c2, std::map< int, std::list< location > > &locs) |
bool | apply (const channel &c1, const channel &c2, std::map< int, std::list< location > > &locs, int &totalLocs) |
bool | apply (const channel &c1, const channel &c2, const channel &c3, std::list< location > &locs) |
bool | apply (const channel &c1, const channel &c2, const channel &c3, std::list< location > &locs, int &totalLocs) |
bool | apply (const channel &c1, const channel &c2, const channel &c3, std::map< int, std::list< location > > &locs) |
bool | apply (const channel &c1, const channel &c2, const channel &c3, std::map< int, std::list< location > > &locs, int &totalLocs) |
Read-only access to the created pyramids in an apply method. | |
const scaleSpacePyramid < channel > & | getSaliencyPyramid () const |
const scaleSpacePyramid < channel > & | getOrientationPyramid () const |
const scaleSpacePyramid < channel > & | getChannelPyramid () const |
Protected Member Functions | |
bool | computeDoGKernel () |
bool | qmaximum (const float ym1, const float y0, const float y1, float &x) const |
float | getAngle (const vector< float > &angles, const int idx) const |
float | edgenessRatio (const channel &chnl, const int y, const int x) const |
void | concatLocsMap (std::map< int, std::list< location > > &src1dest, std::map< int, std::list< location > > &src2) const |
bool | densityFilter (std::map< int, std::list< location > > &srcDest) const |
Saliency Methods | |
void | applyLaplacian (const channel &src, channel &dest) const |
void | applyMag (const channel &src, channel &mag, channel &angle) const |
void | applyCornerness (const channel &src, channel &dest) const |
void | applyDoG (const channel &src, channel &dest) const |
Apply helper methods | |
bool | computePyramids (const channel &src) |
bool | computeLocationsPosition (std::map< int, std::list< location > > &locMap) |
bool | computeLocationOrientation (std::map< int, std::list< location > > &locMap, int &totalLocs) |
Protected Attributes | |
gradientFunctor | gradient |
sepKernel< float > | doGKernel |
scaleSpacePyramid< channel > | iPyr |
scaleSpacePyramid< channel > | lapPyr |
fvector | lapMax |
scaleSpacePyramid< channel > | argPyr |
scaleSpacePyramid< channel > | magPyr |
scaleSpacePyramid< channel > | maxPyr |
double | firstLevelFactor |
Search for salient locations in the scale space of a channel.
The detected locations can be used to extract local features.
For more information see: David G. Lowe "Distinctive Image Features from Scale-Invariant Keypoints" June, 2003
This functor is more robust but also computationally more expensive than its predecessor lti::axLocalRegions.
The method is not 100% any of the variants published by Lowe, but it got his name since the general principle is the one explain in the previously mentioned paper.
One of the major differences with Lowe's approach is the use of a scale-space pyramid where all levels has their own scale. Lowe uses the same size for all level within an octave. The Gaussian smoothing is done here only for the first level, and thereafter only the one required to keep the downsampling valid.
lti::pyramidLocationSearch::pyramidLocationSearch | ( | ) |
Default constructor.
lti::pyramidLocationSearch::pyramidLocationSearch | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::pyramidLocationSearch::pyramidLocationSearch | ( | const pyramidLocationSearch & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::pyramidLocationSearch::~pyramidLocationSearch | ( | ) | [virtual] |
Destructor.
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
const channel & | c3, | |||
std::map< int, std::list< location > > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from the given channel, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
c1 | first color or other feature component | |
c2 | second color or other feature component | |
c3 | third color or other feature component | |
locs | map of lists of relevant locations per level | |
totalLocs | total number of detected locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
const channel & | c3, | |||
std::map< int, std::list< location > > & | locs | |||
) |
Extracts the most relevant locations from the given channel, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
c1 | first color or other feature component | |
c2 | second color or other feature component | |
c3 | third color or other feature component | |
locs | map of lists of relevant locations per level |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
const channel & | c3, | |||
std::list< location > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from the given channel, and return them as list of lti::location objects.
c1 | first color or other feature component | |
c2 | second color or other feature component | |
c3 | third color or other feature component | |
locs | list of relevant locations | |
totalLocs | total number of detected locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
const channel & | c3, | |||
std::list< location > & | locs | |||
) |
Extracts the most relevant locations from the given channel, and return them as list of lti::location objects.
c1 | first color or other feature component | |
c2 | second color or other feature component | |
c3 | third color or other feature component | |
locs | list of relevant locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
std::map< int, std::list< location > > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from both channels, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
c1 | first color or other feature component | |
c2 | second color or other feature component | |
locs | map of lists of relevant locations per level | |
totalLocs | total number of detected locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
std::map< int, std::list< location > > & | locs | |||
) |
Extracts the most relevant locations from both channels, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
c1 | first color or other feature component | |
c2 | second color or other feature component | |
locs | map of lists of relevant locations per level |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
std::list< location > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from both channels, and return them as list of lti::location objects.
c1 | first color or other feature component | |
c2 | second color or other feature component | |
locs | list of relevant locations | |
totalLocs | total number of detected locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | c1, | |
const channel & | c2, | |||
std::list< location > & | locs | |||
) |
Extracts the most relevant locations from both channels, and return them as list of lti::location objects.
c1 | first color or other feature component | |
c2 | second color or other feature component | |
locs | list of relevant locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | src, | |
std::map< int, std::list< location > > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from the given channel, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
src | channel with the source data. | |
locs | map of lists of relevant locations per level | |
totalLocs | total number of detected locations |
bool lti::pyramidLocationSearch::apply | ( | const channel & | src, | |
std::map< int, std::list< location > > & | locs | |||
) |
Extracts the most relevant locations from the given channel, and return them as map where the key equals the level in which the locations where found and the value is a list of lti::location objects in that level.
Note: This apply is faster than apply(const channel&,std::list<location>&).
src | channel with the source data. | |
locs | map of lists of relevant locations per level |
bool lti::pyramidLocationSearch::apply | ( | const channel & | src, | |
std::list< location > & | locs, | |||
int & | totalLocs | |||
) |
Extracts the most relevant locations from the given channel, and return them as list of lti::location objects.
src | channel with the source data. | |
locs | list of relevant locations | |
totalLocs | total number of detected locations |
Extracts the most relevant locations from the given channel, and return them as list of lti::location objects.
src | channel with the source data. | |
locs | list of relevant locations |
void lti::pyramidLocationSearch::applyCornerness | ( | const channel & | src, | |
channel & | dest | |||
) | const [protected] |
Applies the Harris cornerness extraction to the source souce channel this is a measure for the curvature at a pixel.
Applies a DoG kernel to the given channel.
void lti::pyramidLocationSearch::applyLaplacian | ( | const channel & | src, | |
channel & | dest | |||
) | const [protected] |
Applies the edge and/or corner extraction to the source souce channel based on Laplace-Operator.
virtual functor* lti::pyramidLocationSearch::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::functor.
bool lti::pyramidLocationSearch::computeDoGKernel | ( | ) | [protected] |
Compute the doGKernel as wished by the user.
bool lti::pyramidLocationSearch::computeLocationOrientation | ( | std::map< int, std::list< location > > & | locMap, | |
int & | totalLocs | |||
) | [protected] |
Compute the orientation of each location in each level.
The total number of locations is also computed
bool lti::pyramidLocationSearch::computeLocationsPosition | ( | std::map< int, std::list< location > > & | locMap | ) | [protected] |
Compute the position of the locations for each level, based on the pyramids.
bool lti::pyramidLocationSearch::computePyramids | ( | const channel & | src | ) | [protected] |
Compute the pyramids.
void lti::pyramidLocationSearch::concatLocsMap | ( | std::map< int, std::list< location > > & | src1dest, | |
std::map< int, std::list< location > > & | src2 | |||
) | const [protected] |
Transport all data in the second map into the first one, without copying it.
At the end of the operation the second map will be empty.
pyramidLocationSearch& lti::pyramidLocationSearch::copy | ( | const pyramidLocationSearch & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
bool lti::pyramidLocationSearch::densityFilter | ( | std::map< int, std::list< location > > & | srcDest | ) | const [protected] |
float lti::pyramidLocationSearch::edgenessRatio | ( | const channel & | chnl, | |
const int | y, | |||
const int | x | |||
) | const [protected] |
Compute the edgeness ratio.
The value computed here corresponds to the Tr(H)^2/Det(H), with the Hessian matrix H.
This method expects x and y to be greater 1 and to be not larger than 1 minus the last valid index bei each coordinate.
float lti::pyramidLocationSearch::getAngle | ( | const vector< float > & | angles, | |
const int | idx | |||
) | const [protected] |
Compute the angle given an index.
It will use the neighbors to compute the position of the maximum.
const scaleSpacePyramid<channel>& lti::pyramidLocationSearch::getChannelPyramid | ( | ) | const |
const scaleSpacePyramid<channel>& lti::pyramidLocationSearch::getOrientationPyramid | ( | ) | const |
const pyramidLocationSearch::parameters& lti::pyramidLocationSearch::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::transform.
const scaleSpacePyramid<channel>& lti::pyramidLocationSearch::getSaliencyPyramid | ( | ) | const |
virtual const char* lti::pyramidLocationSearch::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("pyramidLocationSearch").
Reimplemented from lti::transform.
pyramidLocationSearch& lti::pyramidLocationSearch::operator= | ( | const pyramidLocationSearch & | other | ) |
bool lti::pyramidLocationSearch::qmaximum | ( | const float | ym1, | |
const float | y0, | |||
const float | y1, | |||
float & | x | |||
) | const [inline, protected] |
Compute the maximum for the given three values, assuming that the middle value has an offset of zero and using a quadratic function that passes through all three points.
The returned value x will be between -1.0 and 1.0 if a maximum was detected, or will remain untouched if no maximum was found. If a maximum is found, the function returns true.
scaleSpacePyramid<channel> lti::pyramidLocationSearch::argPyr [protected] |
Pyramid containing the angles of the gradient, used to compute the rotation of each feature.
sepKernel<float> lti::pyramidLocationSearch::doGKernel [protected] |
Kernel used to compute the DoG.
double lti::pyramidLocationSearch::firstLevelFactor [protected] |
First level factor.
If the pyramid was upsampled, this is the factor with which the first level was created.
gradientFunctor lti::pyramidLocationSearch::gradient [protected] |
Functor used to compute gradients.
scaleSpacePyramid<channel> lti::pyramidLocationSearch::iPyr [protected] |
The required pyramids.
Pyramid of original channel.
fvector lti::pyramidLocationSearch::lapMax [protected] |
Vector containing the maxima at each level of the pyramid.
scaleSpacePyramid<channel> lti::pyramidLocationSearch::lapPyr [protected] |
Pyramid of Laplacians, DoG, Harris cornerness, or gradient magnitude, depending on the mode selected in the parameters.
scaleSpacePyramid<channel> lti::pyramidLocationSearch::magPyr [protected] |
Pyramid containing the magnitude of the gradient.
scaleSpacePyramid<channel> lti::pyramidLocationSearch::maxPyr [protected] |
Pyramid with maxima detected in the lapPyr.
This pyramid will only be initialized if the spatial maximum neighborhood is greater than 3.