KdTree-based nearest neighbor search.
More...
#include <kdtree.hpp>
|
|
| KdTree (const Eigen::Vector4d *points, int num_points, int build_num_threads=1) |
| |
| virtual size_t | knn_search (const double *pt, size_t k, size_t *k_indices, double *k_sq_dists, double max_sq_dist=std::numeric_limits< double >::max()) const override |
| | Find k nearest neighbors.
|
| |
| virtual size_t | radius_search (const double *pt, double radius, std::vector< size_t > &indices, std::vector< double > &sq_dists, int max_num_neighbors=std::numeric_limits< int >::max()) const override |
| | Radius search.
|
| |
|
|
const int | num_points |
| |
|
const Eigen::Vector4d * | points |
| |
|
double | search_eps |
| |
|
std::unique_ptr< Index > | index |
| |
KdTree-based nearest neighbor search.
◆ knn_search()
| virtual size_t gtsam_points::KdTree::knn_search |
( |
const double * |
pt, |
|
|
size_t |
k, |
|
|
size_t * |
k_indices, |
|
|
double * |
k_sq_dists, |
|
|
double |
max_sq_dist = std::numeric_limits< double >::max() |
|
) |
| const |
|
overridevirtual |
Find k nearest neighbors.
- Parameters
-
| pt | Query point (must be 4D vector [x, y, z, 1]) |
| k | Number of neighbors to search |
| k_indices | Indices of k nearest neighbors |
| k_sq_dists | Squared distances of k nearest neighbors |
- Returns
- Number of neighbors found
Reimplemented from gtsam_points::NearestNeighborSearch.
◆ radius_search()
| virtual size_t gtsam_points::KdTree::radius_search |
( |
const double * |
pt, |
|
|
double |
radius, |
|
|
std::vector< size_t > & |
indices, |
|
|
std::vector< double > & |
sq_dists, |
|
|
int |
max_num_neighbors = std::numeric_limits< int >::max() |
|
) |
| const |
|
overridevirtual |
Radius search.
- Note
- There is no assumption and guarantee on the order of points to be selected when
max_num_neighbors is specified. (KdTree tends to first pick closer points though).
- Parameters
-
| pt | Point |
| radius | Search radius |
| indices | Indices of neighbors within the radius |
| sq_dists | Squared distances to the neighbors |
| max_num_neighbors | Maximum number of neighbors |
- Returns
- Number of neighbors
Reimplemented from gtsam_points::NearestNeighborSearch.
The documentation for this struct was generated from the following file:
- /home/runner/work/gtsam_points/gtsam_points/include/gtsam_points/ann/kdtree.hpp