Go to the documentation of this file.
10 #ifndef mrpt_vision_descriptor_kdtrees_H
11 #define mrpt_vision_descriptor_kdtrees_H
23 template <
typename distance_t,
typename element_t = u
int8_t>
25 template <
typename distance_t,
typename element_t =
float>
63 ASSERT_(!feats.
empty() && feats[0]->descriptors.hasDescriptorSIFT());
121 ASSERT_(!feats.
empty() && feats[0]->descriptors.hasDescriptorSIFT());
157 template <
typename distance_t,
typename element_t>
158 struct TSIFTDesc2KDTree_Adaptor
167 const element_t* p1,
const size_t idx_p2,
size_t size)
const
169 const size_t dim =
m_feats[idx_p2]->descriptors.SIFT.
size();
170 const element_t* p2 = &
m_feats[idx_p2]->descriptors.SIFT[0];
172 for (
size_t i = 0; i < dim; i++)
174 d += (*p1 - *p2) * (*p1 - *p2);
183 return m_feats[idx]->descriptors.SIFT[dim];
185 template <
class BBOX>
192 template <
typename distance_t,
typename element_t>
193 struct TSURFDesc2KDTree_Adaptor
202 const element_t* p1,
const size_t idx_p2,
size_t size)
const
204 const size_t dim =
m_feats[idx_p2]->descriptors.SURF.
size();
205 const element_t* p2 = &
m_feats[idx_p2]->descriptors.SURF[0];
207 for (
size_t i = 0; i < dim; i++)
209 d += (*p1 - *p2) * (*p1 - *p2);
218 return m_feats[idx]->descriptors.SURF[dim];
220 template <
class BBOX>
distance_t kdtree_distance(const element_t *p1, const size_t idx_p2, size_t size) const
bool kdtree_get_bbox(BBOX &bb) const
kdtree_t & get_kdtree()
Access to the kd-tree object.
detail::TSIFTDesc2KDTree_Adaptor< distance_t > m_adaptor
void regenerate_kdtreee()
Re-creates the kd-tree, which must be done whenever the data source (the CFeatureList) changes.
kdtree_t & get_kdtree()
Access to the kd-tree object.
TSIFTDescriptorsKDTreeIndex(const CFeatureList &feats)
Constructor from a list of SIFT features.
~TSURFDescriptorsKDTreeIndex()
typename nanoflann::KDTreeSingleIndexAdaptor< metric_t, detail::TSIFTDesc2KDTree_Adaptor< distance_t > > kdtree_t
const kdtree_t & get_kdtree() const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERT_(f)
Defines an assertion mechanism.
~TSIFTDescriptorsKDTreeIndex()
Squared Euclidean (L2) distance functor (suitable for low-dimensionality datasets,...
A list of visual features, to be used as output by detectors, as input/output by trackers,...
void regenerate_kdtreee()
Re-creates the kd-tree, which must be done whenever the data source (the CFeatureList) changes.
element_t kdtree_get_pt(const size_t idx, int dim) const
A kd-tree builder for sets of features with SURF descriptors.
typename nanoflann::KDTreeSingleIndexAdaptor< metric_t, detail::TSURFDesc2KDTree_Adaptor< distance_t > > kdtree_t
detail::TSURFDesc2KDTree_Adaptor< distance_t > m_adaptor
const CFeatureList & m_feats
element_t kdtree_get_pt(const size_t idx, int dim) const
TSURFDesc2KDTree_Adaptor(const CFeatureList &feats)
const CFeatureList & m_feats
const CFeatureList & m_feats
Parameters (see README.md)
bool kdtree_get_bbox(BBOX &bb) const
size_t kdtree_get_point_count() const
distance_t kdtree_distance(const element_t *p1, const size_t idx_p2, size_t size) const
TSURFDescriptorsKDTreeIndex(const CFeatureList &feats)
Constructor from a list of SIFT features.
const kdtree_t & get_kdtree() const
const CFeatureList & m_feats
A kd-tree builder for sets of features with SIFT descriptors.
GLenum const GLfloat * params
TSIFTDesc2KDTree_Adaptor(const CFeatureList &feats)
size_t kdtree_get_point_count() 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 | |