Open3D (C++ API)
0.17.0
|
Namespaces | |
impl | |
Data Structures | |
class | FixedRadiusIndex |
FixedRadiusIndex for nearest neighbor range search. More... | |
class | KnnIndex |
class | MemoryAllocation |
A class for managing memory segments within a memory allocation. More... | |
struct | NanoFlannIndexHolder |
NanoFlann Index Holder. More... | |
class | NanoFlannIndex |
class | NearestNeighborSearch |
A Class for nearest neighbor search. More... | |
class | NeighborSearchAllocator |
struct | NanoFlannIndexHolderBase |
Base struct for NanoFlann index holder. More... | |
class | NNSIndex |
Enumerations | |
enum | Metric { L1 , L2 , Linf } |
Supported metrics. More... | |
Functions | |
template<class T > | |
void | BuildSpatialHashTableCPU (const Tensor &points, double radius, const Tensor &points_row_splits, const Tensor &hash_table_splits, Tensor &hash_table_index, Tensor &hash_table_cell_splits) |
template<class T , class TIndex > | |
void | FixedRadiusSearchCPU (const Tensor &points, const Tensor &queries, double radius, const Tensor &points_row_splits, const Tensor &queries_row_splits, const Tensor &hash_table_splits, const Tensor &hash_table_index, const Tensor &hash_table_cell_splits, const Metric metric, const bool ignore_query_point, const bool return_distances, const bool sort, Tensor &neighbors_index, Tensor &neighbors_row_splits, Tensor &neighbors_distance) |
template<class T , class TIndex > | |
void | HybridSearchCPU (const Tensor &points, const Tensor &queries, double radius, int max_knn, const Tensor &points_row_splits, const Tensor &queries_row_splits, const Tensor &hash_table_splits, const Tensor &hash_table_index, const Tensor &hash_table_cell_splits, const Metric metric, Tensor &neighbors_index, Tensor &neighbors_count, Tensor &neighbors_distance) |
HOST_DEVICE size_t | SpatialHash (int x, int y, int z) |
Spatial hashing function for integer coordinates. More... | |
HOST_DEVICE size_t | SpatialHash (const utility::MiniVec< int, 3 > &xyz) |
template<class TVecf > | |
HOST_DEVICE utility::MiniVec< int, 3 > | ComputeVoxelIndex (const TVecf &pos, const typename TVecf::Scalar_t &inv_voxel_size) |
void open3d::core::nns::BuildSpatialHashTableCPU | ( | const Tensor & | points, |
double | radius, | ||
const Tensor & | points_row_splits, | ||
const Tensor & | hash_table_splits, | ||
Tensor & | hash_table_index, | ||
Tensor & | hash_table_cell_splits | ||
) |
Builds a spatial hash table for a fixed radius search of 3D points.
T | Floating-point data type for the point positions. |
points | The tensor of 3D points. This tensor may be splitted into multiple batch items by defining points_row_splits_size accordingly. |
radius | The radius that will be used for searching. |
points_row_splits | Defines the start and end of the points in each batch item. The size of the tensor is batch_size+1. If there is only 1 batch item then this array is [0, num_points] |
hash_table_splits | Tensor defining the start and end the hash table for each batch item. This is [0, number of cells] if there is only 1 batch item or [0, hash_table_cell_splits_size-1] which is the same. |
hash_table_index | This is an output tensor storing the values of the hash table, which are the indices to the points. The size of the tensor must be equal to the number of points. |
hash_table_cell_splits | This is an output tensor storing the start of each hash table entry. The size of this array defines the size of the hash table. The hash table size is hash_table_cell_splits_size - 1. |
|
inline |
Computes an integer voxel index for a 3D position.
pos | A 3D position. |
inv_voxel_size | The reciprocal of the voxel size |
void open3d::core::nns::FixedRadiusSearchCPU | ( | const Tensor & | points, |
const Tensor & | queries, | ||
double | radius, | ||
const Tensor & | points_row_splits, | ||
const Tensor & | queries_row_splits, | ||
const Tensor & | hash_table_splits, | ||
const Tensor & | hash_table_index, | ||
const Tensor & | hash_table_cell_splits, | ||
const Metric | metric, | ||
const bool | ignore_query_point, | ||
const bool | return_distances, | ||
const bool | sort, | ||
Tensor & | neighbors_index, | ||
Tensor & | neighbors_row_splits, | ||
Tensor & | neighbors_distance | ||
) |
Fixed radius search. This function computes a list of neighbor indices for each query point. The lists are stored linearly and an exclusive prefix sum defines the start and end of list in the array. In addition the function optionally can return the distances for each neighbor in the same format as the indices to the neighbors.
T | Floating-point data type for the point positions. |
points | Tensor with the 3D point positions. This must be the tensor that was used for building the spatial hash table. |
queries | Tensor with the 3D query positions. This may be the same tensor as points . |
radius | The search radius. |
points_row_splits | Defines the start and end of the points in each batch item. The size of the tensor is batch_size+1. If there is only 1 batch item then this tensor is [0, num_points] |
queries_row_splits | Defines the start and end of the queries in each batch item. The size of the tensor is batch_size+1. If there is only 1 batch item then this tensor is [0, num_queries] |
hash_table_splits | Tensor defining the start and end the hash table for each batch item. This is [0, number of cells] if there is only 1 batch item or [0, hash_table_cell_splits_size-1] which is the same. |
hash_table_index | This is an output of the function BuildSpatialHashTableCPU. This is tensor storing the values of the hash table, which are the indices to the points. The size of the tensor must be equal to the number of points. |
hash_table_cell_splits | This is an output of the function BuildSpatialHashTableCPU. The row splits array describing the start and end of each cell. |
metric | One of L1, L2, Linf. Defines the distance metric for the search. |
ignore_query_point | If true then points with the same position as the query point will be ignored. |
return_distances | If true then this function will return the distances for each neighbor to its query point in the same format as the indices. Note that for the L2 metric the squared distances will be returned!! |
sort | If true then sort the results in ascending order of distance |
neighbors_index | The output tensor that saves the resulting neighbor indices |
neighbors_row_splits | Tensor defining the start and end the neighbor indices in each batch item. The size of the tensor is num_query_points + 1 |
neighbors_distance | The output tensor that saves the resulting neighbor distances. |
void open3d::core::nns::HybridSearchCPU | ( | const Tensor & | points, |
const Tensor & | queries, | ||
double | radius, | ||
int | max_knn, | ||
const Tensor & | points_row_splits, | ||
const Tensor & | queries_row_splits, | ||
const Tensor & | hash_table_splits, | ||
const Tensor & | hash_table_index, | ||
const Tensor & | hash_table_cell_splits, | ||
const Metric | metric, | ||
Tensor & | neighbors_index, | ||
Tensor & | neighbors_count, | ||
Tensor & | neighbors_distance | ||
) |
Hybrid search. This function computes a list of neighbor indices for each query point. The lists are stored linearly and if there is less neighbors than requested, the output tensor will be assigned with default values, -1 for indices and 0 for distances. In addition the function returns the number of neighbors for each query.
T | Floating-point data type for the point positions. |
points | Tensor with the 3D point positions. This must be the tensor that was used for building the spatial hash table. |
queries | Tensor with the 3D query positions. This may be the same tensor as points . |
radius | The search radius. |
max_knn | The maximum number of neighbor for each query |
points_row_splits | Defines the start and end of the points in each batch item. The size of the tensor is batch_size+1. If there is only 1 batch item then this tensor is [0, num_points] |
queries_row_splits | Defines the start and end of the queries in each batch item. The size of the tensor is batch_size+1. If there is only 1 batch item then this tensor is [0, num_queries] |
hash_table_splits | Tensor defining the start and end the hash table for each batch item. This is [0, number of cells] if there is only 1 batch item or [0, hash_table_cell_splits_size-1] which is the same. |
hash_table_index | This is an output of the function BuildSpatialHashTableCPU. This is tensor storing the values of the hash table, which are the indices to the points. The size of the tensor must be equal to the number of points. |
hash_table_cell_splits | This is an output of the function BuildSpatialHashTableCPU. The row splits array describing the start and end of each cell. |
metric | One of L1, L2, Linf. Defines the distance metric for the search. |
neighbors_index | The output tensor that saves the resulting neighbor indices |
neighbors_count | The output tensor that saves the number of neighbors for each query points |
neighbors_distance | The output tensor that saves the resulting neighbor distances. |
|
inline |
|
inline |
Spatial hashing function for integer coordinates.