The keypoint base class. More...
#include <SIFT/Keypoint.H>
Public Types | |
enum | CHANNEL { ORI, COL } |
Public Member Functions | |
Constructors, destructor, copy, assigment | |
Keypoint () | |
Uninitialized constructor; will net to call reset() later. | |
Keypoint (const std::vector< byte > &features, const float x, const float y, const float s, const float o, const float dogmag) | |
Constructor. | |
Keypoint (const std::vector< byte > &features, const std::vector< byte > &colFeatures, const float x, const float y, const float s, const float o, const float dogmag, float oriWeight=1.0F, float colWeight=1.0F) | |
Constructor with Color. | |
Keypoint (const Keypoint &k) | |
Copy-constructor. | |
void | reset (const std::vector< byte > &features, const float x, const float y, const float s, const float o, const float dogmag) |
Reset all internal values. | |
~Keypoint () | |
Destructor. | |
Keypoint & | operator= (const Keypoint &k) |
Assignment. | |
int | distSquared (const rutz::shared_ptr< Keypoint > &k) const |
Compute squared distance between two keypoint descriptors. | |
int | maxDistSquared (CHANNEL channel=ORI) const |
Return the maximum possible dist sq between two feature vectors. | |
bool | operator< (const Keypoint &k) const |
Compares the magnitude of this keypoint to the given keypoint. | |
Protected Attributes | |
float | itsX |
our x coordinate | |
float | itsY |
our y coordinate | |
float | itsS |
our scale coordinate | |
float | itsO |
our orientation | |
float | itsM |
our DoG magnitude, for sorting | |
std::vector< byte > | itsOriFV |
our Ori feature vector | |
std::vector< byte > | itsColFV |
our color feature vector | |
float | itsOriWeight |
The weight for ori. | |
float | itsColWeight |
The weight for col. | |
Friends | |
std::istream & | operator>> (std::istream &is, Keypoint &k) |
Load a Keypoint from an istream. | |
std::ostream & | operator<< (std::ostream &os, const Keypoint &k) |
Save a Keypoint to an ostream. | |
Iterators and access functions | |
The iterators iterate on our feature vector data only, while the other access functions can be used to access the other data. | |
typedef std::vector< byte > ::iterator | iterator |
standard iterator | |
typedef std::vector< byte > ::const_iterator | const_iterator |
const iterator | |
const_iterator | begin (CHANNEL channel=ORI) const |
Returns a read-only iterator to the beginning of the feature vec data. | |
const_iterator | end (CHANNEL channel=ORI) const |
Returns a read-only iterator to one-past-the-end of the feature vec data. | |
iterator | beginw (CHANNEL channel=ORI) |
Returns a read-write iterator to the beginning of the feature vec data. | |
iterator | endw (CHANNEL channel=ORI) |
Returns a read-write iterator to one-past-the-end of the feature vec data. | |
float | getX () const |
x getter | |
float | getY () const |
y getter | |
float | getS () const |
scale getter | |
float | getO () const |
orientation getter | |
float | getM () const |
DoG magnitude getter. | |
uint | getFVlength (CHANNEL channel=ORI) const |
Return the length of this keypoint's feature vector. | |
byte | getFVelement (const uint index, CHANNEL channel=ORI) const |
Return the value of the feature vector at the given index. | |
std::vector< byte > | getOriFV () |
Return a copy of the orientation feature vector. | |
std::vector< byte > | getColFV () |
Return a copy of the color feature vector. |
The keypoint base class.
The sift keypoint feature descriptor 3D position (x, y, scale) Mean orientation, magnitude Feature vector
Definition at line 56 of file Keypoint.H.
const iterator
Definition at line 105 of file Keypoint.H.
typedef std::vector<byte>::iterator Keypoint::iterator |
standard iterator
Definition at line 102 of file Keypoint.H.
Keypoint::Keypoint | ( | ) |
Uninitialized constructor; will net to call reset() later.
Definition at line 51 of file Keypoint.C.
Keypoint::Keypoint | ( | const std::vector< byte > & | features, | |
const float | x, | |||
const float | y, | |||
const float | s, | |||
const float | o, | |||
const float | dogmag | |||
) |
Constructor.
Definition at line 57 of file Keypoint.C.
Keypoint::Keypoint | ( | const std::vector< byte > & | features, | |
const std::vector< byte > & | colFeatures, | |||
const float | x, | |||
const float | y, | |||
const float | s, | |||
const float | o, | |||
const float | dogmag, | |||
float | oriWeight = 1.0F , |
|||
float | colWeight = 1.0F | |||
) |
Constructor with Color.
Definition at line 68 of file Keypoint.C.
Keypoint::Keypoint | ( | const Keypoint & | k | ) |
Copy-constructor.
Definition at line 81 of file Keypoint.C.
Keypoint::~Keypoint | ( | ) |
Destructor.
Definition at line 105 of file Keypoint.C.
Keypoint::const_iterator Keypoint::begin | ( | CHANNEL | channel = ORI |
) | const [inline] |
Returns a read-only iterator to the beginning of the feature vec data.
Definition at line 198 of file Keypoint.H.
References itsColFV, and itsOriFV.
Referenced by distSquared().
Keypoint::iterator Keypoint::beginw | ( | CHANNEL | channel = ORI |
) | [inline] |
Returns a read-write iterator to the beginning of the feature vec data.
Definition at line 223 of file Keypoint.H.
int Keypoint::distSquared | ( | const rutz::shared_ptr< Keypoint > & | k | ) | const [inline] |
Compute squared distance between two keypoint descriptors.
Comparisons and feature distance computation
Definition at line 290 of file Keypoint.H.
References ASSERT, begin(), end(), itsColFV, itsColWeight, itsOriFV, and itsOriWeight.
Keypoint::const_iterator Keypoint::end | ( | CHANNEL | channel = ORI |
) | const [inline] |
Returns a read-only iterator to one-past-the-end of the feature vec data.
Definition at line 210 of file Keypoint.H.
References itsColFV, and itsOriFV.
Referenced by distSquared().
Keypoint::iterator Keypoint::endw | ( | CHANNEL | channel = ORI |
) | [inline] |
Returns a read-write iterator to one-past-the-end of the feature vec data.
Definition at line 235 of file Keypoint.H.
std::vector<byte> Keypoint::getColFV | ( | ) | [inline] |
Return a copy of the color feature vector.
Definition at line 144 of file Keypoint.H.
References itsColFV.
Return the value of the feature vector at the given index.
Definition at line 275 of file Keypoint.H.
uint Keypoint::getFVlength | ( | CHANNEL | channel = ORI |
) | const [inline] |
Return the length of this keypoint's feature vector.
Definition at line 263 of file Keypoint.H.
float Keypoint::getM | ( | ) | const [inline] |
float Keypoint::getO | ( | ) | const [inline] |
std::vector<byte> Keypoint::getOriFV | ( | ) | [inline] |
Return a copy of the orientation feature vector.
Definition at line 141 of file Keypoint.H.
References itsOriFV.
float Keypoint::getS | ( | ) | const [inline] |
float Keypoint::getX | ( | ) | const [inline] |
float Keypoint::getY | ( | ) | const [inline] |
int Keypoint::maxDistSquared | ( | CHANNEL | channel = ORI |
) | const [inline] |
Return the maximum possible dist sq between two feature vectors.
This is just a function of the size of our feature vector
Definition at line 324 of file Keypoint.H.
bool Keypoint::operator< | ( | const Keypoint & | k | ) | const [inline] |
Compares the magnitude of this keypoint to the given keypoint.
This is useful, for example, to use std::sort() on an std::vector< rutz::shared_ptr<Keypoint> >. Just remember that the comparison is based on the magnitude of the DoG only, not on any other internal data of the Keypoint.
Definition at line 336 of file Keypoint.H.
References itsM.
void Keypoint::reset | ( | const std::vector< byte > & | features, | |
const float | x, | |||
const float | y, | |||
const float | s, | |||
const float | o, | |||
const float | dogmag | |||
) |
std::ostream& operator<< | ( | std::ostream & | os, | |
const Keypoint & | k | |||
) | [friend] |
Save a Keypoint to an ostream.
Definition at line 109 of file Keypoint.C.
std::istream& operator>> | ( | std::istream & | is, | |
Keypoint & | k | |||
) | [friend] |
Load a Keypoint from an istream.
Definition at line 123 of file Keypoint.C.
std::vector<byte> Keypoint::itsColFV [protected] |
our color feature vector
Definition at line 175 of file Keypoint.H.
Referenced by begin(), beginw(), distSquared(), end(), endw(), getColFV(), getFVelement(), getFVlength(), and maxDistSquared().
float Keypoint::itsColWeight [protected] |
float Keypoint::itsM [protected] |
our DoG magnitude, for sorting
Definition at line 173 of file Keypoint.H.
Referenced by getM(), operator<(), operator<<(), operator=(), operator>>(), and reset().
float Keypoint::itsO [protected] |
our orientation
Definition at line 172 of file Keypoint.H.
Referenced by getO(), operator<<(), operator=(), operator>>(), and reset().
std::vector<byte> Keypoint::itsOriFV [protected] |
our Ori feature vector
Definition at line 174 of file Keypoint.H.
Referenced by begin(), beginw(), distSquared(), end(), endw(), getFVelement(), getFVlength(), getOriFV(), maxDistSquared(), operator<<(), operator=(), operator>>(), and reset().
float Keypoint::itsOriWeight [protected] |
float Keypoint::itsS [protected] |
our scale coordinate
Definition at line 171 of file Keypoint.H.
Referenced by getS(), operator<<(), operator=(), operator>>(), and reset().
float Keypoint::itsX [protected] |
our x coordinate
Definition at line 169 of file Keypoint.H.
Referenced by getX(), operator<<(), operator=(), operator>>(), and reset().
float Keypoint::itsY [protected] |
our y coordinate
Definition at line 170 of file Keypoint.H.
Referenced by getY(), operator<<(), operator=(), operator>>(), and reset().