Open3D (C++ API)
0.12.0
|
Data Structures | |
class | FaissIndex |
Faiss for nearest neighbor search. More... | |
class | FixedRadiusIndex |
FixedRadiusIndex for nearest neighbor range search. More... | |
class | MemoryAllocation |
A class for managing memory segments within a memory allocation. More... | |
class | NanoFlannIndex |
struct | NanoFlannIndexHolder |
NanoFlann Index Holder. More... | |
struct | NanoFlannIndexHolderBase |
Base struct for Index holder. More... | |
class | NearestNeighborSearch |
A Class for nearest neighbor search. More... | |
class | NeighborSearchAllocator |
class | NNSIndex |
Enumerations | |
enum | Metric { L1, L2, Linf, L1, L2, Linf } |
Distance metric enum. More... | |
enum | Metric { L1, L2, Linf, L1, L2, Linf } |
Supported metrics. More... | |
Functions | |
template<class TReal , class TIndex > | |
void | BuildSpatialHashTableCUDA (void *temp, size_t &temp_size, const size_t num_points, const TReal *const points, const TReal radius, const size_t points_row_splits_size, const int64_t *points_row_splits, const TIndex *hash_table_splits, const size_t hash_table_cell_splits_size, TIndex *hash_table_cell_splits, TIndex *hash_table_index) |
template<class T > | |
void | FixedRadiusSearchCUDA (void *temp, size_t &temp_size, int64_t *query_neighbors_row_splits, size_t num_points, const T *const points, size_t num_queries, const T *const queries, const T radius, const size_t points_row_splits_size, const int64_t *const points_row_splits, const size_t queries_row_splits_size, const int64_t *const queries_row_splits, const uint32_t *const hash_table_splits, size_t hash_table_cell_splits_size, const uint32_t *const hash_table_cell_splits, const uint32_t *const hash_table_index, NeighborSearchAllocator< T > &output_allocator) |
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::BuildSpatialHashTableCUDA | ( | void * | temp, |
size_t & | temp_size, | ||
const size_t | num_points, | ||
const TReal *const | points, | ||
const TReal | radius, | ||
const size_t | points_row_splits_size, | ||
const int64_t * | points_row_splits, | ||
const TIndex * | hash_table_splits, | ||
const size_t | hash_table_cell_splits_size, | ||
TIndex * | hash_table_cell_splits, | ||
TIndex * | hash_table_index | ||
) |
Builds a spatial hash table for a fixed radius search of 3D points.
All pointer arguments point to device memory unless stated otherwise.
temp | Pointer to temporary memory. If nullptr then the required size of temporary memory will be written to temp_size and no work is done. |
temp_size | The size of the temporary memory in bytes. This is used as an output if temp is nullptr |
texture_alignment | The texture alignment in bytes. This is used for allocating segments within the temporary memory. |
num_points | The number of points. |
points | The array of 3D points. |
radius | The radius that will be used for searching. |
points_row_splits_size | The size of the points_row_splits array. The size of the array is batch_size+1. |
points_row_splits | This pointer points to host memory. Defines the start and end of the points in each batch item. The size of the array is batch_size+1. If there is only 1 batch item then this array is [0, num_points] |
hash_table_splits | This pointer points to host memory. Array 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_cell_splits_size | This is the length of the hash_table_cell_splits array. |
hash_table_cell_splits | This is an output array 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. |
hash_table_index | This is an output array storing the values of the hash table, which are the indices to the points. The size of the array must be equal to the number of points. |
|
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::FixedRadiusSearchCUDA | ( | void * | temp, |
size_t & | temp_size, | ||
int64_t * | query_neighbors_row_splits, | ||
size_t | num_points, | ||
const T *const | points, | ||
size_t | num_queries, | ||
const T *const | queries, | ||
const T | radius, | ||
const size_t | points_row_splits_size, | ||
const int64_t *const | points_row_splits, | ||
const size_t | queries_row_splits_size, | ||
const int64_t *const | queries_row_splits, | ||
const uint32_t *const | hash_table_splits, | ||
size_t | hash_table_cell_splits_size, | ||
const uint32_t *const | hash_table_cell_splits, | ||
const uint32_t *const | hash_table_index, | ||
NeighborSearchAllocator< T > & | output_allocator | ||
) |
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.
All pointer arguments point to device memory unless stated otherwise.
T | Floating-point data type for the point positions. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
temp | Pointer to temporary memory. If nullptr then the required size of temporary memory will be written to temp_size and no work is done. |
temp_size | The size of the temporary memory in bytes. This is used as an output if temp is nullptr |
texture_alignment | The texture alignment in bytes. This is used for allocating segments within the temporary memory. |
query_neighbors_row_splits | This is the output pointer for the prefix sum. The length of this array is num_queries + 1. |
num_points | The number of points. |
points | Array with the 3D point positions. This may be the same array as queries . |
num_queries | The number of query points. |
queries | Array with the 3D query positions. This may be the same array as points . |
radius | The search radius. |
points_row_splits_size | The size of the points_row_splits array. The size of the array is batch_size+1. |
points_row_splits | This pointer points to host memory. Defines the start and end of the points in each batch item. The size of the array is batch_size+1. If there is only 1 batch item then this array is [0, num_points] |
queries_row_splits_size | The size of the queries_row_splits array. The size of the array is batch_size+1. |
queries_row_splits | This pointer points to host memory. Defines the start and end of the queries in each batch item. The size of the array is batch_size+1. If there is only 1 batch item then this array is [0, num_queries] |
hash_table_splits | This pointer points to host memory. Array 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_cell_splits_size | This is the length of the hash_table_cell_splits array. |
hash_table_cell_splits | This is an output of the function BuildSpatialHashTableCUDA. The row splits array describing the start and end of each cell. |
hash_table_index | This is an output of the function BuildSpatialHashTableCUDA. This is array storing the values of the hash table, which are the indices to the points. The size of the array must be equal to the number of points. |
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!! |
output_allocator | An object that implements functions for allocating the output arrays. The object must implement functions AllocIndices(int32_t** ptr, size_t size) and AllocDistances(T** ptr, size_t size). Both functions should allocate memory and return a pointer to that memory in ptr. Argument size specifies the size of the array as the number of elements. Both functions must accept the argument size==0. In this case ptr does not need to be set. |
|
inline |
Spatial hashing function for integer coordinates.
|
inline |