Go to the documentation of this file.
9 #ifndef _mrpt_vision_TSimpleFeature_H
10 #define _mrpt_vision_TSimpleFeature_H
34 template <
typename PIXEL_COORD_TYPE>
60 template <
typename COORD_TYPE>
68 template <
typename OTHER_TSIMPLEFEATURE>
89 template <
typename FEATURE>
113 template <
typename FEATURE>
129 if (this->
empty())
return 0;
173 typename TFeatureVector::const_reverse_iterator;
239 return static_cast<float>(1 <<
m_feats[i].octave);
243 return m_feats[i].track_status;
306 template <
typename FEATURE_LIST>
308 :
public std::function<bool(size_t, size_t)>
323 template <
typename FEAT>
355 const float* p1,
const size_t idx_p2,
size_t size)
const
360 const float d0 = p1[0] -
m_data[idx_p2].pt.x;
361 const float d1 = p1[1] -
m_data[idx_p2].pt.y;
362 return d0 * d0 + d1 * d1;
371 template <
typename BBOX>
typename PIXEL_COORD_TYPE::pixel_coord_t pixel_coord_t
The type of pt.x and pt.y.
PIXEL_COORD_TYPE pixel_coords_t
The type of pt.
TSimpleFeatureTraits< FEATURE >::coord_t getFeatureY(size_t i) const
TFeatureTrackStatus getTrackStatus(size_t i)
typename TFeatureVector::const_iterator const_iterator
const Scalar * const_iterator
Helper class: KD-tree search class for vector<KeyPoint>: Call mark_as_outdated() to force rebuilding ...
void setFeatureID(size_t i, TFeatureID id)
const std::vector< size_t > & getFirstIndexPerRowLUT() const
Returns a vector with a LUT of the first feature index per row, to efficiently look for neighbors,...
iterator erase(const iterator &it)
TFeatureID getFeatureID(size_t i) const
const FEATURE & front() const
float getFeatureResponse(size_t i) const
mrpt::math::CMatrixBool & getOccupiedSectionsMatrix()
Get a ref to the occupation matrix: this is a user-defined matrix, which is not updated automatically...
TSimpleFeature_templ()
Default constructor, leaves all fields uninitialized.
void setFeatureX(size_t i, typename TSimpleFeatureTraits< FEATURE >::coord_t x)
Declares a matrix of booleans (non serializable).
std::vector< TSimpleFeature > TFeatureVector
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 ...
const std::vector< FEAT > & m_data
void setFeatureResponse(size_t i, float r)
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
const FEATURE_LIST & m_data
A generic adaptor class for providing Nearest Neighbor (NN) lookup via the nanoflann library.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
pixel_coords_t pt
Coordinates in the image.
void mark_as_outdated() const
const mrpt::math::CMatrixBool & getOccupiedSectionsMatrix() const
static coord_t f2coord(float f)
const_iterator begin() const
uint64_t TFeatureID
Definition of a feature ID.
const FEATURE & back() const
typename TFeatureVector::reverse_iterator reverse_iterator
GLdouble GLdouble GLdouble r
float kdtree_get_pt(const size_t idx, int dim) const
Returns the dim'th component of the idx'th point in the class:
TSimpleFeature_templ(const OTHER_TSIMPLEFEATURE &o)
TFeatureVector m_feats
The actual container with the list of features.
void setScale(size_t i, float s)
std::vector< size_t > & getFirstIndexPerRowLUT()
This is an overloaded member function, provided for convenience. It differs from the above function o...
GLsizei GLsizei GLenum GLenum const GLvoid * data
std::vector< size_t > m_first_index_per_row
A LUT of the first feature index per row, to efficiently look for neighbors, etc.
TFeatureTrackStatus track_status
Status of the feature tracking process.
typename TFeatureVector::const_reverse_iterator const_reverse_iterator
int round(const T value)
Returns the closer integer (int) to x.
TSimpleFeature_templ(const COORD_TYPE x, const COORD_TYPE y)
Constructor that only sets the pt.
A helper struct to sort keypoints by their response: It can be used with these types:
void keep_max(T &var, const K test_val)
If the second argument is above the first one, set the first argument to this higher value.
void setTrackStatus(size_t i, TFeatureTrackStatus s)
TSimpleFeatureTraits< FEATURE >::coord_t getFeatureX(size_t i) const
uint8_t user_flags
A field for any other flags needed by the user (this has not a predefined meaning)
const_reverse_iterator rend() const
const TFeatureVector & getVector() const
Returns a const ref to the actual std::vector<> container.
CFeatureListKDTree(const std::vector< FEAT > &data)
bool isPointFeature(size_t i) const
TFeatureID getMaxID() const
Returns the maximum ID of all features in the list, or 0 if it's empty.
void setFeatureXf(size_t i, float x)
KeypointResponseSorter(const FEATURE_LIST &data)
const_iterator end() const
float getScale(size_t i) const
const FEATURE & operator[](const unsigned int index) const
const_reverse_iterator rbegin() const
FEATURE & operator[](const unsigned int index)
A simple structure for representing one image feature (without descriptor nor patch) - This is the te...
void push_back_fast(const int x, const int y)
static coord_t f2coord(float f)
float response
A measure of the "goodness" of the feature (typically, the KLT_response value)
size_t kdtree_get_point_count() const
Must return the number of data points.
uint8_t octave
The image octave the image was found in: 0=original image, 1=1/2 image, 2=1/4 image,...
void setFeatureY(size_t i, typename TSimpleFeatureTraits< FEATURE >::coord_t y)
void push_back(const FEATURE &f)
bool kdtree_get_bbox(BBOX &bb) const
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
reverse_iterator rbegin()
mrpt::math::CMatrixBool m_occupied_sections
TFeatureID ID
ID of the feature.
void push_back_fast(const FEATURE &f)
typename TFeatureVector::iterator iterator
void kdtree_mark_as_outdated() const
To be called by child classes when KD tree data changes.
void setFeatureYf(size_t i, float y)
A list of image features using the structure TSimpleFeature for each feature.
bool operator()(size_t k1, size_t k2) const
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |