Keypoint Class Reference

The keypoint base class. More...

#include <SIFT/Keypoint.H>

Collaboration diagram for Keypoint:
Collaboration graph
[legend]

List of all members.

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.
Keypointoperator= (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< byteitsOriFV
 our Ori feature vector
std::vector< byteitsColFV
 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< bytegetOriFV ()
 Return a copy of the orientation feature vector.
std::vector< bytegetColFV ()
 Return a copy of the color feature vector.

Detailed Description

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.


Member Typedef Documentation

const iterator

Definition at line 105 of file Keypoint.H.

standard iterator

Definition at line 102 of file Keypoint.H.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

References itsColFV, and itsOriFV.

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.

References itsColFV, and itsOriFV.

std::vector<byte> Keypoint::getColFV (  )  [inline]

Return a copy of the color feature vector.

Definition at line 144 of file Keypoint.H.

References itsColFV.

byte Keypoint::getFVelement ( const uint  index,
CHANNEL  channel = ORI 
) const [inline]

Return the value of the feature vector at the given index.

Definition at line 275 of file Keypoint.H.

References ASSERT, itsColFV, and itsOriFV.

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.

References itsColFV, and itsOriFV.

float Keypoint::getM (  )  const [inline]

DoG magnitude getter.

Definition at line 260 of file Keypoint.H.

References itsM.

float Keypoint::getO (  )  const [inline]

orientation getter

Definition at line 257 of file Keypoint.H.

References itsO.

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]

scale getter

Definition at line 254 of file Keypoint.H.

References itsS.

float Keypoint::getX (  )  const [inline]

x getter

Definition at line 248 of file Keypoint.H.

References itsX.

float Keypoint::getY (  )  const [inline]

y getter

Definition at line 251 of file Keypoint.H.

References itsY.

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.

References itsColFV, and itsOriFV.

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.

Keypoint & Keypoint::operator= ( const Keypoint k  ) 

Assignment.

Definition at line 97 of file Keypoint.C.

References itsM, itsO, itsOriFV, itsS, itsX, and itsY.

void Keypoint::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.

Definition at line 87 of file Keypoint.C.

References itsM, itsO, itsOriFV, itsS, itsX, and itsY.


Friends And Related Function Documentation

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.


Member Data Documentation

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]

The weight for col.

Definition at line 177 of file Keypoint.H.

Referenced by distSquared().

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().

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]

The weight for ori.

Definition at line 176 of file Keypoint.H.

Referenced by distSquared().

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().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:29 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3