Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
mrpt::vision::CFeatureList Class Reference

Detailed Description

A list of visual features, to be used as output by detectors, as input/output by trackers, etc.

#include <mrpt/vision/CFeature.h>

Inheritance diagram for mrpt::vision::CFeatureList:
Inheritance graph
[legend]

List of all members.

Public Types

typedef KDTreeCapable< Derived,
num_t, metric_t > 
self_t

Public Member Functions

TFeatureType get_type () const
 The type of the first feature in the list.
void saveToTextFile (const std::string &fileName, bool APPEND=false)
 Save feature list to a text file.
void loadFromTextFile (const std::string &fileName)
 Save feature list to a text file.
void copyListFrom (const CFeatureList &otherList)
 Copies the content of another CFeatureList inside this one.
TFeatureID getMaxID () const
 Get the maximum ID into the list.
CFeaturePtr getByID (const TFeatureID &ID) const
 Get a reference to a Feature from its ID.
CFeaturePtr getByID (const TFeatureID &ID, int &out_idx) const
void getByMultiIDs (const vector< TFeatureID > &IDs, vector< CFeaturePtr > &out, vector< int > &outIndex) const
 Get a vector of references to a subset of features from their IDs.
CFeaturePtr nearest (const float x, const float y, double &max_dist) const
 Get a reference to the nearest feature to the a given 2D point (version returning distance to closest feature in "max_dist")
 CFeatureList ()
 Constructor.
virtual ~CFeatureList ()
 Virtual destructor.
void mark_kdtree_as_outdated () const
 Call this when the list of features has been modified so the KD-tree is marked as outdated.
const Derived & derived () const
 CRTP helper method.
Derived & derived ()
 CRTP helper method.
Methods that MUST be implemented by children classes of KDTreeCapable
size_t kdtree_get_point_count () const
 Must return the number of data points.
float kdtree_get_pt (const size_t idx, int dim) const
 Returns the dim'th component of the idx'th point in the class:
float kdtree_distance (const float *p1, const size_t idx_p2, size_t size) const
 Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:
template<typename BBOX >
bool kdtree_get_bbox (BBOX &bb) const
getFeature*() methods for template-based access to feature list
float getFeatureX (size_t i) const
float getFeatureY (size_t i) const
TFeatureID getFeatureID (size_t i) const
float getFeatureResponse (size_t i) const
bool isPointFeature (size_t i) const
float getScale (size_t i) const
TFeatureTrackStatus getTrackStatus (size_t i)
void setFeatureX (size_t i, float x)
void setFeatureXf (size_t i, float x)
void setFeatureY (size_t i, float y)
void setFeatureYf (size_t i, float y)
void setFeatureID (size_t i, TFeatureID id)
void setFeatureResponse (size_t i, float r)
void setScale (size_t i, float s)
void setTrackStatus (size_t i, TFeatureTrackStatus s)
void mark_as_outdated () const
Public utility methods to query the KD-tree
size_t kdTreeClosestPoint2D (float x0, float y0, float &out_x, float &out_y, float &out_dist_sqr) const
 KD Tree-based search for the closest point (only ONE) to some given 2D coordinates.
size_t kdTreeClosestPoint2D (float x0, float y0, float &out_dist_sqr) const
size_t kdTreeClosestPoint2D (const TPoint2D &p0, TPoint2D &pOut, float &outDistSqr) const
float kdTreeClosestPoint2DsqrError (float x0, float y0) const
 Like kdTreeClosestPoint2D, but just return the square error from some point to its closest neighbor.
float kdTreeClosestPoint2DsqrError (const TPoint2D &p0) const
void kdTreeTwoClosestPoint2D (float x0, float y0, float &out_x1, float &out_y1, float &out_x2, float &out_y2, float &out_dist_sqr1, float &out_dist_sqr2) const
 KD Tree-based search for the TWO closest point to some given 2D coordinates.
void kdTreeTwoClosestPoint2D (const TPoint2D &p0, TPoint2D &pOut1, TPoint2D &pOut2, float &outDistSqr1, float &outDistSqr2) const
std::vector< int > kdTreeNClosestPoint2D (float x0, float y0, size_t knn, std::vector< float > &out_x, std::vector< float > &out_y, std::vector< float > &out_dist_sqr) const
 KD Tree-based search for the N closest point to some given 2D coordinates.
std::vector< int > kdTreeNClosestPoint2D (const TPoint2D &p0, size_t N, std::vector< TPoint2D > &pOut, std::vector< float > &outDistSqr) const
void kdTreeNClosestPoint2DIdx (float x0, float y0, size_t knn, std::vector< int > &out_idx, std::vector< float > &out_dist_sqr) const
 KD Tree-based search for the N closest point to some given 2D coordinates and returns their indexes.
void kdTreeNClosestPoint2DIdx (const TPoint2D &p0, size_t N, std::vector< int > &outIdx, std::vector< float > &outDistSqr) const
size_t kdTreeClosestPoint3D (float x0, float y0, float z0, float &out_x, float &out_y, float &out_z, float &out_dist_sqr) const
 KD Tree-based search for the closest point (only ONE) to some given 3D coordinates.
size_t kdTreeClosestPoint3D (float x0, float y0, float z0, float &out_dist_sqr) const
size_t kdTreeClosestPoint3D (const TPoint3D &p0, TPoint3D &pOut, float &outDistSqr) const
void kdTreeNClosestPoint3D (float x0, float y0, float z0, size_t knn, std::vector< float > &out_x, std::vector< float > &out_y, std::vector< float > &out_z, std::vector< float > &out_dist_sqr) const
 KD Tree-based search for the N closest points to some given 3D coordinates.
void kdTreeNClosestPoint3D (const TPoint3D &p0, size_t N, std::vector< TPoint3D > &pOut, std::vector< float > &outDistSqr) const
void kdTreeNClosestPoint3DIdx (float x0, float y0, float z0, size_t knn, std::vector< int > &out_idx, std::vector< float > &out_dist_sqr) const
 KD Tree-based search for the N closest point to some given 3D coordinates and returns their indexes.
void kdTreeNClosestPoint3DIdx (const TPoint3D &p0, size_t N, std::vector< int > &outIdx, std::vector< float > &outDistSqr) const

Public Attributes

TKDTreeSearchParams kdtree_search_params
 Parameters to tune the ANN searches.

Protected Types

typedef std::vector< CFeaturePtrTInternalFeatList

Protected Member Functions

void kdtree_mark_as_outdated () const
 To be called by child classes when KD tree data changes.

Protected Attributes

TInternalFeatList m_feats
 The actual container with the list of features.

Method and datatypes to emulate a STL container

typedef TInternalFeatList::iterator iterator
typedef
TInternalFeatList::const_iterator 
const_iterator
typedef
TInternalFeatList::reverse_iterator 
reverse_iterator
typedef
TInternalFeatList::const_reverse_iterator 
const_reverse_iterator
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
iterator erase (const iterator it)
bool empty () const
size_t size () const
void clear ()
void resize (size_t N)
void push_back (const CFeaturePtr &f)
CFeaturePtroperator[] (const unsigned int index)
const CFeaturePtroperator[] (const unsigned int index) const

Member Typedef Documentation

Definition at line 280 of file CFeature.h.

typedef TInternalFeatList::const_reverse_iterator mrpt::vision::CFeatureList::const_reverse_iterator

Definition at line 283 of file CFeature.h.

Definition at line 279 of file CFeature.h.

typedef TInternalFeatList::reverse_iterator mrpt::vision::CFeatureList::reverse_iterator

Definition at line 282 of file CFeature.h.

typedef KDTreeCapable<Derived,num_t,metric_t> mrpt::math::KDTreeCapable::self_t [inherited]

Definition at line 90 of file KDTreeCapable.h.

Definition at line 232 of file CFeature.h.


Constructor & Destructor Documentation

mrpt::vision::CFeatureList::CFeatureList ( )

Constructor.

virtual mrpt::vision::CFeatureList::~CFeatureList ( ) [virtual]

Virtual destructor.


Member Function Documentation

iterator mrpt::vision::CFeatureList::begin ( ) [inline]
const_iterator mrpt::vision::CFeatureList::begin ( ) const [inline]

Definition at line 287 of file CFeature.h.

void mrpt::vision::CFeatureList::clear ( void  ) [inline]

Definition at line 300 of file CFeature.h.

void mrpt::vision::CFeatureList::copyListFrom ( const CFeatureList otherList)

Copies the content of another CFeatureList inside this one.

The inner features are also copied.

const Derived& mrpt::math::KDTreeCapable::derived ( ) const [inline, inherited]

CRTP helper method.

Definition at line 100 of file KDTreeCapable.h.

Derived& mrpt::math::KDTreeCapable::derived ( ) [inline, inherited]

CRTP helper method.

Definition at line 102 of file KDTreeCapable.h.

bool mrpt::vision::CFeatureList::empty ( ) const [inline]

Definition at line 297 of file CFeature.h.

iterator mrpt::vision::CFeatureList::end ( ) [inline]
const_iterator mrpt::vision::CFeatureList::end ( ) const [inline]

Definition at line 288 of file CFeature.h.

iterator mrpt::vision::CFeatureList::erase ( const iterator  it) [inline]

Definition at line 295 of file CFeature.h.

TFeatureType mrpt::vision::CFeatureList::get_type ( ) const [inline]

The type of the first feature in the list.

Definition at line 238 of file CFeature.h.

References empty(), mrpt::vision::featNotDefined, begin(), and get_type().

Referenced by get_type().

CFeaturePtr mrpt::vision::CFeatureList::getByID ( const TFeatureID ID) const

Get a reference to a Feature from its ID.

CFeaturePtr mrpt::vision::CFeatureList::getByID ( const TFeatureID ID,
int &  out_idx 
) const
void mrpt::vision::CFeatureList::getByMultiIDs ( const vector< TFeatureID > &  IDs,
vector< CFeaturePtr > &  out,
vector< int > &  outIndex 
) const

Get a vector of references to a subset of features from their IDs.

TFeatureID mrpt::vision::CFeatureList::getFeatureID ( size_t  i) const [inline]

Definition at line 347 of file CFeature.h.

float mrpt::vision::CFeatureList::getFeatureResponse ( size_t  i) const [inline]

Definition at line 348 of file CFeature.h.

float mrpt::vision::CFeatureList::getFeatureX ( size_t  i) const [inline]

Definition at line 345 of file CFeature.h.

float mrpt::vision::CFeatureList::getFeatureY ( size_t  i) const [inline]

Definition at line 346 of file CFeature.h.

TFeatureID mrpt::vision::CFeatureList::getMaxID ( ) const

Get the maximum ID into the list.

float mrpt::vision::CFeatureList::getScale ( size_t  i) const [inline]

Definition at line 350 of file CFeature.h.

TFeatureTrackStatus mrpt::vision::CFeatureList::getTrackStatus ( size_t  i) [inline]

Definition at line 351 of file CFeature.h.

bool mrpt::vision::CFeatureList::isPointFeature ( size_t  i) const [inline]

Definition at line 349 of file CFeature.h.

float mrpt::vision::CFeatureList::kdtree_distance ( const float *  p1,
const size_t  idx_p2,
size_t  size 
) const [inline]

Returns the distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:

Definition at line 325 of file CFeature.h.

References ASSERTDEB_.

template<typename BBOX >
bool mrpt::vision::CFeatureList::kdtree_get_bbox ( BBOX &  bb) const [inline]

Definition at line 338 of file CFeature.h.

size_t mrpt::vision::CFeatureList::kdtree_get_point_count ( ) const [inline]

Must return the number of data points.

Definition at line 315 of file CFeature.h.

References mrpt::math::size().

float mrpt::vision::CFeatureList::kdtree_get_pt ( const size_t  idx,
int  dim 
) const [inline]

Returns the dim'th component of the idx'th point in the class:

Definition at line 318 of file CFeature.h.

References ASSERTDEB_.

void mrpt::math::KDTreeCapable::kdtree_mark_as_outdated ( ) const [inline, protected, inherited]

To be called by child classes when KD tree data changes.

Definition at line 575 of file KDTreeCapable.h.

References mrpt::math::KDTreeCapable::m_kdtree_is_uptodate.

size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint2D ( float  x0,
float  y0,
float &  out_x,
float &  out_y,
float &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the closest point (only ONE) to some given 2D coordinates.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 3D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
out_xThe X coordinate of the found closest correspondence.
out_yThe Y coordinate of the found closest correspondence.
out_dist_sqrThe square distance between the query and the returned point.
Returns:
The index of the closest point in the map array.
See also:
kdTreeClosestPoint3D, kdTreeTwoClosestPoint2D

Definition at line 136 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_2D(), mrpt::math::KDTreeCapable::m_kdtree2d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, mrpt::math::KDTreeCapable::derived(), and MRPT_END.

size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint2D ( float  x0,
float  y0,
float &  out_dist_sqr 
) const [inline, inherited]
size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint2D ( const TPoint2D p0,
TPoint2D pOut,
float &  outDistSqr 
) const [inline, inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 189 of file KDTreeCapable.h.

References mrpt::math::KDTreeCapable::kdTreeClosestPoint2D(), mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.

float mrpt::math::KDTreeCapable::kdTreeClosestPoint2DsqrError ( float  x0,
float  y0 
) const [inline, inherited]

Like kdTreeClosestPoint2D, but just return the square error from some point to its closest neighbor.

Definition at line 199 of file KDTreeCapable.h.

References mrpt::math::KDTreeCapable::kdTreeClosestPoint2D().

float mrpt::math::KDTreeCapable::kdTreeClosestPoint2DsqrError ( const TPoint2D p0) const [inline, inherited]
size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint3D ( float  x0,
float  y0,
float  z0,
float &  out_x,
float &  out_y,
float &  out_z,
float &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the closest point (only ONE) to some given 3D coordinates.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 2D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
z0The Z coordinate of the query.
out_xThe X coordinate of the found closest correspondence.
out_yThe Y coordinate of the found closest correspondence.
out_zThe Z coordinate of the found closest correspondence.
out_dist_sqrThe square distance between the query and the returned point.
Returns:
The index of the closest point in the map array.
See also:
kdTreeClosestPoint2D

Definition at line 394 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_3D(), mrpt::math::KDTreeCapable::m_kdtree3d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, mrpt::math::KDTreeCapable::derived(), and MRPT_END.

size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint3D ( float  x0,
float  y0,
float  z0,
float &  out_dist_sqr 
) const [inline, inherited]
size_t mrpt::math::KDTreeCapable::kdTreeClosestPoint3D ( const TPoint3D p0,
TPoint3D pOut,
float &  outDistSqr 
) const [inline, inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 454 of file KDTreeCapable.h.

References mrpt::math::KDTreeCapable::kdTreeClosestPoint3D(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

std::vector<int> mrpt::math::KDTreeCapable::kdTreeNClosestPoint2D ( float  x0,
float  y0,
size_t  knn,
std::vector< float > &  out_x,
std::vector< float > &  out_y,
std::vector< float > &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the N closest point to some given 2D coordinates.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 3D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
NThe number of closest points to search.
out_xThe vector containing the X coordinates of the correspondences.
out_yThe vector containing the Y coordinates of the correspondences.
out_dist_sqrThe vector containing the square distance between the query and the returned points.
Returns:
The list of indices
See also:
kdTreeClosestPoint2D
kdTreeTwoClosestPoint2D

Definition at line 293 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_2D(), mrpt::math::KDTreeCapable::m_kdtree2d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, mrpt::math::KDTreeCapable::derived(), and MRPT_END.

std::vector<int> mrpt::math::KDTreeCapable::kdTreeNClosestPoint2D ( const TPoint2D p0,
size_t  N,
std::vector< TPoint2D > &  pOut,
std::vector< float > &  outDistSqr 
) const [inline, inherited]
void mrpt::math::KDTreeCapable::kdTreeNClosestPoint2DIdx ( float  x0,
float  y0,
size_t  knn,
std::vector< int > &  out_idx,
std::vector< float > &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the N closest point to some given 2D coordinates and returns their indexes.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 3D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
NThe number of closest points to search.
out_idxThe indexes of the found closest correspondence.
out_dist_sqrThe square distance between the query and the returned point.
See also:
kdTreeClosestPoint2D

Definition at line 351 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_2D(), mrpt::math::KDTreeCapable::m_kdtree2d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, and MRPT_END.

void mrpt::math::KDTreeCapable::kdTreeNClosestPoint2DIdx ( const TPoint2D p0,
size_t  N,
std::vector< int > &  outIdx,
std::vector< float > &  outDistSqr 
) const [inline, inherited]
void mrpt::math::KDTreeCapable::kdTreeNClosestPoint3D ( float  x0,
float  y0,
float  z0,
size_t  knn,
std::vector< float > &  out_x,
std::vector< float > &  out_y,
std::vector< float > &  out_z,
std::vector< float > &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the N closest points to some given 3D coordinates.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 2D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
z0The Z coordinate of the query.
NThe number of closest points to search.
out_xThe vector containing the X coordinates of the correspondences.
out_yThe vector containing the Y coordinates of the correspondences.
out_zThe vector containing the Z coordinates of the correspondences.
out_dist_sqrThe vector containing the square distance between the query and the returned points.
See also:
kdTreeNClosestPoint2D

Definition at line 480 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_3D(), mrpt::math::KDTreeCapable::m_kdtree3d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, mrpt::math::KDTreeCapable::derived(), and MRPT_END.

void mrpt::math::KDTreeCapable::kdTreeNClosestPoint3D ( const TPoint3D p0,
size_t  N,
std::vector< TPoint3D > &  pOut,
std::vector< float > &  outDistSqr 
) const [inline, inherited]
void mrpt::math::KDTreeCapable::kdTreeNClosestPoint3DIdx ( float  x0,
float  y0,
float  z0,
size_t  knn,
std::vector< int > &  out_idx,
std::vector< float > &  out_dist_sqr 
) const [inline, inherited]

KD Tree-based search for the N closest point to some given 3D coordinates and returns their indexes.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 2D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
z0The Z coordinate of the query.
NThe number of closest points to search.
out_idxThe indexes of the found closest correspondence.
out_dist_sqrThe square distance between the query and the returned point.
See also:
kdTreeClosestPoint2D

Definition at line 543 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_3D(), mrpt::math::KDTreeCapable::m_kdtree3d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, and MRPT_END.

void mrpt::math::KDTreeCapable::kdTreeNClosestPoint3DIdx ( const TPoint3D p0,
size_t  N,
std::vector< int > &  outIdx,
std::vector< float > &  outDistSqr 
) const [inline, inherited]
void mrpt::math::KDTreeCapable::kdTreeTwoClosestPoint2D ( float  x0,
float  y0,
float &  out_x1,
float &  out_y1,
float &  out_x2,
float &  out_y2,
float &  out_dist_sqr1,
float &  out_dist_sqr2 
) const [inline, inherited]

KD Tree-based search for the TWO closest point to some given 2D coordinates.

This method automatically build the "m_kdtree_data" structure when:

  • It is called for the first time
  • The map has changed
  • The KD-tree was build for 3D.
Parameters:
x0The X coordinate of the query.
y0The Y coordinate of the query.
out_x1The X coordinate of the first correspondence.
out_y1The Y coordinate of the first correspondence.
out_x2The X coordinate of the second correspondence.
out_y2The Y coordinate of the second correspondence.
out_dist_sqr1The square distance between the query and the first returned point.
out_dist_sqr2The square distance between the query and the second returned point.
See also:
kdTreeClosestPoint2D

Definition at line 229 of file KDTreeCapable.h.

References MRPT_START, mrpt::math::KDTreeCapable::rebuild_kdTree_2D(), mrpt::math::KDTreeCapable::m_kdtree2d_data, mrpt::math::KDTreeCapable::TKDTreeDataHolder::m_num_points, THROW_EXCEPTION, nanoflann::KNNResultSet::init(), mrpt::math::KDTreeCapable::TKDTreeDataHolder::query_point, mrpt::math::KDTreeCapable::TKDTreeDataHolder::index, mrpt::math::KDTreeCapable::kdtree_search_params, mrpt::math::KDTreeCapable::TKDTreeSearchParams::nChecks, mrpt::math::KDTreeCapable::derived(), and MRPT_END.

void mrpt::math::KDTreeCapable::kdTreeTwoClosestPoint2D ( const TPoint2D p0,
TPoint2D pOut1,
TPoint2D pOut2,
float &  outDistSqr1,
float &  outDistSqr2 
) const [inline, inherited]
void mrpt::vision::CFeatureList::loadFromTextFile ( const std::string fileName)

Save feature list to a text file.

void mrpt::vision::CFeatureList::mark_as_outdated ( ) const [inline]

Definition at line 363 of file CFeature.h.

void mrpt::vision::CFeatureList::mark_kdtree_as_outdated ( ) const [inline]

Call this when the list of features has been modified so the KD-tree is marked as outdated.

Definition at line 275 of file CFeature.h.

CFeaturePtr mrpt::vision::CFeatureList::nearest ( const float  x,
const float  y,
double &  max_dist 
) const

Get a reference to the nearest feature to the a given 2D point (version returning distance to closest feature in "max_dist")

Parameters:
x[IN] The query point x-coordinate
y[IN] The query point y-coordinate
max_dist[IN/OUT] At input: The maximum distance to search for. At output: The actual distance to the feature.
Returns:
A reference to the found feature, or a NULL smart pointer if none found.
Note:
See also all the available KD-tree search methods, listed in mrpt::math::KDTreeCapable
CFeaturePtr& mrpt::vision::CFeatureList::operator[] ( const unsigned int  index) [inline]

Definition at line 305 of file CFeature.h.

const CFeaturePtr& mrpt::vision::CFeatureList::operator[] ( const unsigned int  index) const [inline]

Definition at line 306 of file CFeature.h.

void mrpt::vision::CFeatureList::push_back ( const CFeaturePtr f) [inline]

Definition at line 303 of file CFeature.h.

reverse_iterator mrpt::vision::CFeatureList::rbegin ( ) [inline]

Definition at line 290 of file CFeature.h.

const_reverse_iterator mrpt::vision::CFeatureList::rbegin ( ) const [inline]

Definition at line 292 of file CFeature.h.

reverse_iterator mrpt::vision::CFeatureList::rend ( ) [inline]

Definition at line 291 of file CFeature.h.

const_reverse_iterator mrpt::vision::CFeatureList::rend ( ) const [inline]

Definition at line 293 of file CFeature.h.

void mrpt::vision::CFeatureList::resize ( size_t  N) [inline]

Definition at line 301 of file CFeature.h.

void mrpt::vision::CFeatureList::saveToTextFile ( const std::string fileName,
bool  APPEND = false 
)

Save feature list to a text file.

void mrpt::vision::CFeatureList::setFeatureID ( size_t  i,
TFeatureID  id 
) [inline]

Definition at line 358 of file CFeature.h.

void mrpt::vision::CFeatureList::setFeatureResponse ( size_t  i,
float  r 
) [inline]

Definition at line 359 of file CFeature.h.

void mrpt::vision::CFeatureList::setFeatureX ( size_t  i,
float  x 
) [inline]

Definition at line 353 of file CFeature.h.

void mrpt::vision::CFeatureList::setFeatureXf ( size_t  i,
float  x 
) [inline]

Definition at line 354 of file CFeature.h.

void mrpt::vision::CFeatureList::setFeatureY ( size_t  i,
float  y 
) [inline]

Definition at line 355 of file CFeature.h.

References Eigen::internal::y.

void mrpt::vision::CFeatureList::setFeatureYf ( size_t  i,
float  y 
) [inline]

Definition at line 356 of file CFeature.h.

References Eigen::internal::y.

void mrpt::vision::CFeatureList::setScale ( size_t  i,
float  s 
) [inline]

Definition at line 360 of file CFeature.h.

void mrpt::vision::CFeatureList::setTrackStatus ( size_t  i,
TFeatureTrackStatus  s 
) [inline]

Definition at line 361 of file CFeature.h.

size_t mrpt::vision::CFeatureList::size ( ) const [inline]

Definition at line 298 of file CFeature.h.


Member Data Documentation

TKDTreeSearchParams mrpt::math::KDTreeCapable::kdtree_search_params [inherited]

Parameters to tune the ANN searches.

Definition at line 116 of file KDTreeCapable.h.

The actual container with the list of features.

Definition at line 234 of file CFeature.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011