KdTree implementation based on FLANN.
More...
#include <easy3d/kdtree/kdtree_search_flann.h>
|
| KdTreeSearch_FLANN (const PointCloud *cloud) |
| Constructor. More...
|
|
| KdTreeSearch_FLANN (const std::vector< vec3 > &points) |
| Constructor. More...
|
|
void | set_checks (int chk) |
| Specifies the maximum number of leaves to visit when searching for neighbors. More...
|
|
|
int | find_closest_point (const vec3 &p, float &squared_distance) const override |
| Queries the closest point for a given point. More...
|
|
int | find_closest_point (const vec3 &p) const override |
| Queries the closest point for a given point. More...
|
|
|
void | find_closest_k_points (const vec3 &p, int k, std::vector< int > &neighbors, std::vector< float > &squared_distances) const override |
| Queries the K nearest neighbors for a given point. More...
|
|
void | find_closest_k_points (const vec3 &p, int k, std::vector< int > &neighbors) const override |
| Queries the K nearest neighbors for a given point. More...
|
|
|
void | find_points_in_range (const vec3 &p, float squared_radius, std::vector< int > &neighbors, std::vector< float > &squared_distances) const override |
| Queries the nearest neighbors within a fixed range. More...
|
|
void | find_points_in_range (const vec3 &p, float squared_radius, std::vector< int > &neighbors) const override |
| Queries the nearest neighbors within a fixed range. More...
|
|
| KdTreeSearch (const PointCloud *cloud) |
| Constructor. More...
|
|
| KdTreeSearch (const std::vector< vec3 > &points) |
| Constructor. More...
|
|
◆ KdTreeSearch_FLANN() [1/2]
Constructor.
- Parameters
-
cloud | The point cloud for which a KdTree will be constructed. |
◆ KdTreeSearch_FLANN() [2/2]
Constructor.
- Parameters
-
points | The points for which a KdTree will be constructed. |
◆ find_closest_k_points() [1/2]
void find_closest_k_points |
( |
const vec3 & |
p, |
|
|
int |
k, |
|
|
std::vector< int > & |
neighbors |
|
) |
| const |
|
overridevirtual |
Queries the K nearest neighbors for a given point.
- Parameters
-
p | The query point. |
k | The number of required neighbors. |
neighbors | The indices of the neighbors found. |
Implements KdTreeSearch.
◆ find_closest_k_points() [2/2]
void find_closest_k_points |
( |
const vec3 & |
p, |
|
|
int |
k, |
|
|
std::vector< int > & |
neighbors, |
|
|
std::vector< float > & |
squared_distances |
|
) |
| const |
|
overridevirtual |
Queries the K nearest neighbors for a given point.
- Parameters
-
p | The query point. |
k | The number of required neighbors. |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the query point and its K nearest neighbors. The values are stored in accordance with their indices. |
- Note
- The squared distances are returned by the argument
squared_distances
.
Implements KdTreeSearch.
◆ find_closest_point() [1/2]
int find_closest_point |
( |
const vec3 & |
p | ) |
const |
|
overridevirtual |
Queries the closest point for a given point.
- Parameters
-
- Returns
- The index of the nearest neighbor found.
Implements KdTreeSearch.
◆ find_closest_point() [2/2]
int find_closest_point |
( |
const vec3 & |
p, |
|
|
float & |
squared_distance |
|
) |
| const |
|
overridevirtual |
Queries the closest point for a given point.
- Parameters
-
p | The query point. |
squared_distance | The squared distance between the query point and its closest neighbor. |
- Note
- A squared distance is returned by the second argument
squared_distance
.
- Returns
- The index of the nearest neighbor found.
Implements KdTreeSearch.
◆ find_points_in_range() [1/2]
void find_points_in_range |
( |
const vec3 & |
p, |
|
|
float |
squared_radius, |
|
|
std::vector< int > & |
neighbors |
|
) |
| const |
|
overridevirtual |
Queries the nearest neighbors within a fixed range.
- Parameters
-
p | The query point. |
squared_radius | The search range (which is required to be squared). |
neighbors | The indices of the neighbors found. |
Implements KdTreeSearch.
◆ find_points_in_range() [2/2]
void find_points_in_range |
( |
const vec3 & |
p, |
|
|
float |
squared_radius, |
|
|
std::vector< int > & |
neighbors, |
|
|
std::vector< float > & |
squared_distances |
|
) |
| const |
|
overridevirtual |
Queries the nearest neighbors within a fixed range.
- Parameters
-
p | The query point. |
squared_radius | The search range (which is required to be squared). |
neighbors | The indices of the neighbors found. |
squared_distances | The squared distances between the query point and the neighbors found. The values are stored in accordance with their indices. |
- Note
- The squared distances are returned by the argument
squared_distances
.
Implements KdTreeSearch.
◆ set_checks()
void set_checks |
( |
int |
chk | ) |
|
Specifies the maximum number of leaves to visit when searching for neighbors.
- Parameters
-
chk | The maximum number of leaves to visit. A higher value for this parameter would give better search precision, but also take more time. For all leaves to be checked use the value FLANN_CHECKS_UNLIMITED. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, to use that value specify FLANN_CHECKS_AUTOTUNED. The default value is FLANN_CHECKS_AUTOTUNED. (Liangliang: 32 is also a good value). |
The documentation for this class was generated from the following files:
- /Users/lnan/Documents/Projects/Easy3D/easy3d/kdtree/kdtree_search_flann.h
- /Users/lnan/Documents/Projects/Easy3D/easy3d/kdtree/kdtree_search_flann.cpp