|
typedef Cloud_T | CloudType |
| a column-major Eigen matrix in which each column is a point; this matrix has dim rows More...
|
|
enum | CreationOptionFlags { TOUCH_STATISTICS = 1
} |
| creation option More...
|
|
typedef int | Index |
| an index to a Vector or a Matrix, for refering to data points More...
|
|
typedef Eigen::Matrix< Index, Eigen::Dynamic, Eigen::Dynamic > | IndexMatrix |
| a matrix of indices to data points More...
|
|
typedef Eigen::Matrix< Index, Eigen::Dynamic, 1 > | IndexVector |
| a vector of indices to data points More...
|
|
typedef Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | Matrix |
| a column-major Eigen matrix in which each column is a point; this matrix has dim rows More...
|
|
enum | SearchOptionFlags { ALLOW_SELF_MATCH = 1,
SORT_RESULTS = 2
} |
| search option More...
|
|
enum | SearchType {
BRUTE_FORCE = 0,
KDTREE_LINEAR_HEAP,
KDTREE_TREE_HEAP,
KDTREE_CL_PT_IN_NODES,
KDTREE_CL_PT_IN_LEAVES,
BRUTE_FORCE_CL,
SEARCH_TYPE_COUNT
} |
| type of search More...
|
|
typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > | Vector |
| an Eigen vector of type T, to hold the coordinates of a point More...
|
|
|
unsigned long | knn (const Vector &query, IndexVector &indices, Vector &dists2, const Index k=1, const T epsilon=0, const unsigned optionFlags=0, const T maxRadius=std::numeric_limits< T >::infinity()) const |
| Find the k nearest neighbours of query. More...
|
|
virtual unsigned long | knn (const Matrix &query, IndexMatrix &indices, Matrix &dists2, const Index k=1, const T epsilon=0, const unsigned optionFlags=0, const T maxRadius=std::numeric_limits< T >::infinity()) const =0 |
| Find the k nearest neighbours for each point of query. More...
|
|
virtual unsigned long | knn (const Matrix &query, IndexMatrix &indices, Matrix &dists2, const Vector &maxRadii, const Index k=1, const T epsilon=0, const unsigned optionFlags=0) const =0 |
| Find the k nearest neighbours for each point of query. More...
|
|
virtual | ~NearestNeighbourSearch () |
| virtual destructor More...
|
|
|
static NearestNeighbourSearch * | create (const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const SearchType preferedType=KDTREE_LINEAR_HEAP, const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Create a nearest-neighbour search. More...
|
|
template<typename WrongMatrixType > |
static NearestNeighbourSearch * | create (const WrongMatrixType &cloud, const Index dim=std::numeric_limits< Index >::max(), const SearchType preferedType=KDTREE_LINEAR_HEAP, const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Prevent creation of trees with the wrong matrix type. Currently only dynamic size matrices are supported. More...
|
|
static NearestNeighbourSearch * | createBruteForce (const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0) |
| Create a nearest-neighbour search, using brute-force search, useful for comparison only. More...
|
|
template<typename WrongMatrixType > |
static NearestNeighbourSearch * | createBruteForce (const WrongMatrixType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0) |
| Prevent creation of trees with the wrong matrix type. Currently only dynamic size matrices are supported. More...
|
|
static NearestNeighbourSearch * | createKDTreeLinearHeap (const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Create a nearest-neighbour search, using a kd-tree with linear heap, good for small k (~up to 30) More...
|
|
template<typename WrongMatrixType > |
static NearestNeighbourSearch * | createKDTreeLinearHeap (const WrongMatrixType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Prevent creation of trees with the wrong matrix type. Currently only dynamic size matrices are supported. More...
|
|
static NearestNeighbourSearch * | createKDTreeTreeHeap (const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Create a nearest-neighbour search, using a kd-tree with tree heap, good for large k (~from 30) More...
|
|
template<typename WrongMatrixType > |
static NearestNeighbourSearch * | createKDTreeTreeHeap (const WrongMatrixType &, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters()) |
| Prevent creation of trees with the wrong matrix type. Currently only dynamic size matrices are supported. More...
|
|
template<typename T, typename Cloud_T = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
struct Nabo::NearestNeighbourSearch< T, Cloud_T >
Nearest neighbour search interface, templatized on scalar type.
Definition at line 258 of file nabo.h.
template<typename T , typename CloudType >
Create a nearest-neighbour search, using brute-force search, useful for comparison only.
This is an helper function, you can also use create() with BRUTE_FORCE as preferedType
- Parameters
-
cloud | data-point cloud in which to search |
dim | number of dimensions to consider, must be lower or equal to cloud.rows() |
creationOptionFlags | creation options, a bitwise OR of elements of CreationOptionFlags |
- Returns
- an object on which to run nearest neighbour queries
Definition at line 158 of file nabo/nabo.cpp.
template<typename T, typename Cloud_T = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
template<typename WrongMatrixType >
Prevent creation of trees with the wrong matrix type. Currently only dynamic size matrices are supported.
Definition at line 401 of file nabo.h.
template<typename T , typename CloudType >
Create a nearest-neighbour search, using a kd-tree with linear heap, good for small k (~up to 30)
This is an helper function, you can also use create() with KDTREE_LINEAR_HEAP as preferedType
- Parameters
-
cloud | data-point cloud in which to search |
dim | number of dimensions to consider, must be lower or equal to cloud.rows() |
creationOptionFlags | creation options, a bitwise OR of elements of CreationOptionFlags |
additionalParameters | additional parameters |
- Returns
- an object on which to run nearest neighbour queries
Definition at line 166 of file nabo/nabo.cpp.
template<typename T , typename CloudType >
Create a nearest-neighbour search, using a kd-tree with tree heap, good for large k (~from 30)
This is an helper function, you can also use create() with KDTREE_TREE_HEAP as preferedType
- Parameters
-
cloud | data-point cloud in which to search |
dim | number of dimensions to consider, must be lower or equal to cloud.rows() |
creationOptionFlags | creation options, a bitwise OR of elements of CreationOptionFlags |
additionalParameters | additional parameters |
- Returns
- an object on which to run nearest neighbour queries
Definition at line 174 of file nabo/nabo.cpp.
template<typename T, typename CloudType >
unsigned long NearestNeighbourSearch::knn |
( |
const Vector & |
query, |
|
|
IndexVector & |
indices, |
|
|
Vector & |
dists2, |
|
|
const Index |
k = 1 , |
|
|
const T |
epsilon = 0 , |
|
|
const unsigned |
optionFlags = 0 , |
|
|
const T |
maxRadius = std::numeric_limits<T>::infinity() |
|
) |
| const |
Find the k nearest neighbours of query.
If the search finds less than k points, the empty entries in dists2 will be filled with InvalidValue and the indices with InvalidIndex. If you must query more than one point at once, use the version of the knn() function taking matrices as input, because it is much faster.
- Parameters
-
query | query point |
indices | indices of nearest neighbours, must be of size k |
dists2 | squared distances to nearest neighbours, must be of size k |
k | number of nearest neighbour requested |
epsilon | maximal ratio of error for approximate search, 0 for exact search; has no effect if the number of neighbour found is smaller than the number requested |
optionFlags | search options, a bitwise OR of elements of SearchOptionFlags |
maxRadius | maximum radius in which to search, can be used to prune search, is not affected by epsilon |
- Returns
- if creationOptionFlags contains TOUCH_STATISTICS, return the number of point touched, otherwise return 0
Definition at line 83 of file nabo/nabo.cpp.
template<typename T, typename Cloud_T = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
Find the k nearest neighbours for each point of query.
If the search finds less than k points, the empty entries in dists2 will be filled with InvalidValue and the indices with InvalidIndex.
- Parameters
-
query | query points |
indices | indices of nearest neighbours, must be of size k x query.cols() |
dists2 | squared distances to nearest neighbours, must be of size k x query.cols() |
k | number of nearest neighbour requested |
epsilon | maximal ratio of error for approximate search, 0 for exact search; has no effect if the number of neighbour found is smaller than the number requested |
optionFlags | search options, a bitwise OR of elements of SearchOptionFlags |
maxRadius | maximum radius in which to search, can be used to prune search, is not affected by epsilon |
- Returns
- if creationOptionFlags contains TOUCH_STATISTICS, return the number of point touched, otherwise return 0
template<typename T, typename Cloud_T = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>>
Find the k nearest neighbours for each point of query.
If the search finds less than k points, the empty entries in dists2 will be filled with InvalidValue and the indices with InvalidIndex.
- Parameters
-
query | query points |
indices | indices of nearest neighbours, must be of size k x query.cols() |
dists2 | squared distances to nearest neighbours, must be of size k x query.cols() |
maxRadii | vector of maximum radii in which to search, used to prune search, is not affected by epsilon |
k | number of nearest neighbour requested |
epsilon | maximal ratio of error for approximate search, 0 for exact search; has no effect if the number of neighbour found is smaller than the number requested |
optionFlags | search options, a bitwise OR of elements of SearchOptionFlags |
- Returns
- if creationOptionFlags contains TOUCH_STATISTICS, return the number of point touched, otherwise return 0