9 #ifndef _mrpt_vision_TSimpleFeature_H 10 #define _mrpt_vision_TSimpleFeature_H 32 template <
typename PIXEL_COORD_TYPE>
58 template <
typename COORD_TYPE>
66 template <
typename OTHER_TSIMPLEFEATURE>
87 template <
typename FEATURE>
111 template <
typename FEATURE>
127 if (this->
empty())
return 0;
171 typename TFeatureVector::const_reverse_iterator;
237 return static_cast<float>(1 <<
m_feats[i].octave);
241 return m_feats[i].track_status;
304 template <
typename FEATURE_LIST>
306 :
public std::function<bool(size_t, size_t)>
321 template <
typename FEAT>
353 const float* p1,
const size_t idx_p2,
size_t size)
const 358 const float d0 = p1[0] -
m_data[idx_p2].pt.x;
359 const float d1 = p1[1] -
m_data[idx_p2].pt.y;
360 return d0 * d0 + d1 * d1;
369 template <
typename BBOX>
mrpt::math::CMatrixBool m_occupied_sections
Helper class: KD-tree search class for vector<KeyPoint>: Call mark_as_outdated() to force rebuilding ...
void setFeatureResponse(size_t i, float r)
uint64_t TFeatureID
Definition of a feature ID.
void setFeatureYf(size_t i, float y)
Declares a matrix of booleans (non serializable).
const FEATURE_LIST & m_data
CFeatureListKDTree(const std::vector< FEAT > &data)
void push_back_fast(const FEATURE &f)
typename TFeatureVector::iterator iterator
static coord_t f2coord(float f)
void mark_as_outdated() const
const mrpt::math::CMatrixBool & getOccupiedSectionsMatrix() const
const_iterator begin() const
typename TFeatureVector::const_iterator const_iterator
typename PIXEL_COORD_TYPE::pixel_coord_t pixel_coord_t
The type of pt.x and pt.y.
float kdtree_get_pt(const size_t idx, int dim) const
Returns the dim'th component of the idx'th point in the class:
void setFeatureID(size_t i, TFeatureID id)
TFeatureVector m_feats
The actual container with the list of features.
void setScale(size_t i, float s)
const FEATURE & front() const
std::vector< size_t > m_first_index_per_row
A LUT of the first feature index per row, to efficiently look for neighbors, etc. ...
typename TFeatureVector::const_reverse_iterator const_reverse_iterator
TFeatureTrackStatus track_status
Status of the feature tracking process.
A helper struct to sort keypoints by their response: It can be used with these types: ...
mrpt::math::CMatrixBool & getOccupiedSectionsMatrix()
Get a ref to the occupation matrix: this is a user-defined matrix, which is not updated automatically...
A generic adaptor class for providing Nearest Neighbor (NN) lookup via the nanoflann library...
void setFeatureX(size_t i, typename TSimpleFeatureTraits< FEATURE >::coord_t x)
TSimpleFeatureTraits< FEATURE >::coord_t getFeatureX(size_t i) const
TSimpleFeature_templ()
Default constructor, leaves all fields uninitialized.
bool isPointFeature(size_t i) const
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...
const TFeatureVector & getVector() const
Returns a const ref to the actual std::vector<> container.
PIXEL_COORD_TYPE pixel_coords_t
The type of pt.
const_iterator end() const
Classes for computer vision, detectors, features, etc.
const FEATURE & operator[](const unsigned int index) const
uint8_t octave
The image octave the image was found in: 0=original image, 1=1/2 image, 2=1/4 image, etc.
FEATURE & operator[](const unsigned int index)
uint8_t user_flags
A field for any other flags needed by the user (this has not a predefined meaning) ...
typename TFeatureVector::reverse_iterator reverse_iterator
const FEATURE & back() const
void push_back(const FEATURE &f)
GLdouble GLdouble GLdouble r
TFeatureID ID
ID of the feature.
std::vector< size_t > & getFirstIndexPerRowLUT()
reverse_iterator rbegin()
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
pixel_coords_t pt
Coordinates in the image.
float response
A measure of the "goodness" of the feature (typically, the KLT_response value)
void kdtree_mark_as_outdated() const
To be called by child classes when KD tree data changes.
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 setTrackStatus(size_t i, TFeatureTrackStatus s)
A simple structure for representing one image feature (without descriptor nor patch) - This is the te...
const_reverse_iterator rend() const
void setFeatureXf(size_t i, float x)
TFeatureID getMaxID() const
Returns the maximum ID of all features in the list, or 0 if it's empty.
float getScale(size_t i) const
static coord_t f2coord(float f)
A list of image features using the structure TSimpleFeature for each feature.
TSimpleFeatureTraits< FEATURE >::coord_t getFeatureY(size_t i) const
TFeatureTrackStatus getTrackStatus(size_t i)
TSimpleFeature_templ(const OTHER_TSIMPLEFEATURE &o)
void push_back_fast(const int x, const int y)
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...
const_reverse_iterator rbegin() const
GLsizei GLsizei GLenum GLenum const GLvoid * data
iterator erase(const iterator &it)
const Scalar * const_iterator
TFeatureID getFeatureID(size_t i) const
TSimpleFeature_templ(const COORD_TYPE x, const COORD_TYPE y)
Constructor that only sets the pt.
size_t kdtree_get_point_count() const
Must return the number of data points.
float getFeatureResponse(size_t i) const
bool operator()(size_t k1, size_t k2) const
bool kdtree_get_bbox(BBOX &bb) const
std::vector< TSimpleFeature > TFeatureVector
KeypointResponseSorter(const FEATURE_LIST &data)
void setFeatureY(size_t i, typename TSimpleFeatureTraits< FEATURE >::coord_t y)
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
int round(const T value)
Returns the closer integer (int) to x.