Open3D (C++ API)
0.12.0
|
Data Structures | |
class | Accumulator |
class | AccumulatorBackprop |
class | Adaptor |
Adaptor for nanoflann. More... | |
struct | InterpolationVec |
Class for computing interpolation weights. More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR > |
Implementation for LINEAR (uses coordinate clamping) More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::LINEAR_BORDER > |
Implementation for LINEAR_BORDER (uses zero border instead of clamping) More... | |
struct | InterpolationVec< T, VECSIZE, InterpolationMode::NEAREST_NEIGHBOR > |
Implementation for NEAREST_NEIGHBOR. More... | |
class | MemoryAllocation |
A class for managing memory segments within a memory allocation. More... | |
struct | SelectNanoflannAdaptor |
struct | SelectNanoflannAdaptor< L1, T > |
struct | SelectNanoflannAdaptor< L2, T > |
Enumerations | |
enum | InterpolationMode { InterpolationMode::LINEAR, InterpolationMode::LINEAR_BORDER, NEAREST_NEIGHBOR } |
enum | CoordinateMapping { CoordinateMapping::BALL_TO_CUBE_RADIAL, CoordinateMapping::BALL_TO_CUBE_VOLUME_PRESERVING, CoordinateMapping::IDENTITY } |
enum | Metric { L1, L2, Linf } |
Supported metrics. More... | |
enum | AccumulationFn { AVERAGE = 0, NEAREST_NEIGHBOR, NEAREST_NEIGHBOR, MAX, CENTER } |
Functions | |
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE> | |
void | _CConvComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, bool normalize) |
template<class TReal , class TIndex > | |
void | CConvComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool POINT_IMPORTANCE> | |
void | _CConvBackropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, bool normalize) |
template<class TReal , class TIndex > | |
void | CConvBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_importance, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TReal , class TIndex > | |
void | FillColumn (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TReal , class TIndex > | |
void | FillColumnTranspose (const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_neighbors_importance_sum, const int64_t *const __restrict__ inp_neighbors_prefix_sum, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class T > | |
void | MultiplyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ col_major_matrix, const T *const __restrict__ vector) |
template<class T > | |
void | MultiplyAndCopyColumns (const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ out_ptr, const T *const __restrict__ col_major_matrix, const T *const __restrict__ vector) |
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE> | |
void | _CConvTransposeComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets) |
template<class TReal , class TIndex > | |
void | CConvTransposeComputeFeaturesCPU (TReal *out_features, const std::vector< int > &filter_dims, const TReal *filter, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t neighbors_index_size, const TIndex *neighbor_index, const TReal *neighbor_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class TReal , class TIndex , InterpolationMode INTERPOLATION, CoordinateMapping MAPPING, bool ALIGN_CORNERS, bool INDIVIDUAL_EXTENT, bool ISOTROPIC_EXTENT, bool NORMALIZE> | |
void | _CConvTransposeBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient) |
template<class TReal , class TIndex > | |
void | CConvTransposeBackpropFilterCPU (TReal *filter_backprop, const std::vector< int > &filter_dims, size_t num_out, const TReal *out_positions, const TReal *out_importance, size_t num_inp, const TReal *inp_positions, const TReal *inp_features, const TReal *inp_neighbors_importance_sum, const int64_t *inp_neighbors_row_splits, size_t num_indices, const TIndex *neighbors_index, const TReal *neighbors_importance, const int64_t *neighbors_row_splits, const TReal *extents, const TReal *offsets, const TReal *out_features_gradient, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize) |
template<class T , int VECSIZE> | |
void | MapSphereToCylinder (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z) |
template<class T , int VECSIZE> | |
void | MapCylinderToCube (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z) |
template<bool ALIGN_CORNERS, CoordinateMapping MAPPING, class T , int VECSIZE> | |
void | ComputeFilterCoordinates (Eigen::Array< T, VECSIZE, 1 > &x, Eigen::Array< T, VECSIZE, 1 > &y, Eigen::Array< T, VECSIZE, 1 > &z, const Eigen::Array< int, 3, 1 > &filter_size, const Eigen::Array< T, VECSIZE, 3 > &inv_extents, const Eigen::Array< T, 3, 1 > &offset) |
template<class T , class OUTPUT_ALLOCATOR > | |
void | FixedRadiusSearchCPU (int64_t *query_neighbors_row_splits, const size_t num_points, const T *const points, const 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, const size_t hash_table_cell_splits_size, const uint32_t *const hash_table_cell_splits, const uint32_t *const hash_table_index, const Metric metric, const bool ignore_query_point, const bool return_distances, OUTPUT_ALLOCATOR &output_allocator) |
template<class TIndex , class TAttr > | |
void | InvertNeighborsListCPU (const TIndex *const inp_neighbors_index, const TAttr *const inp_neighbors_attributes, const int num_attributes_per_neighbor, const int64_t *const inp_neighbors_row_splits, const size_t inp_num_queries, TIndex *out_neighbors_index, TAttr *out_neighbors_attributes, const size_t index_size, int64_t *out_neighbors_row_splits, const size_t out_num_queries) |
template<class T , class OUTPUT_ALLOCATOR > | |
void | KnnSearchCPU (int64_t *query_neighbors_row_splits, size_t num_points, const T *const points, size_t num_queries, const T *const queries, const int k, const Metric metric, const bool ignore_query_point, const bool return_distances, OUTPUT_ALLOCATOR &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) |
template<class T , class OUTPUT_ALLOCATOR > | |
void | RadiusSearchCPU (int64_t *query_neighbors_row_splits, size_t num_points, const T *const points, size_t num_queries, const T *const queries, const T *radii, const Metric metric, const bool ignore_query_point, const bool return_distances, const bool normalize_distances, OUTPUT_ALLOCATOR &output_allocator) |
template<class T > | |
void | RaggedToDenseCPU (const T *const values, const int64_t *const row_splits, const size_t row_splits_size, const size_t out_col_size, const T *const default_value, const size_t default_value_size, T *out_values) |
template<class T > | |
void | ReduceSubarraysSumCPU (const T *const values, const size_t values_size, const int64_t *const row_splits, const size_t num_arrays, T *out_sums) |
template<class T , int NDIM, class OUTPUT_ALLOCATOR > | |
void | VoxelizeCPU (size_t num_points, const T *const points, const T *const voxel_size, const T *const points_range_min, const T *const points_range_max, const int64_t max_points_per_voxel, const int64_t max_voxels, OUTPUT_ALLOCATOR &output_allocator) |
template<class T > | |
bool | CheckVoxelSize (std::string &err, const size_t num_positions, const T *const positions, const T voxel_size) |
Function for debugging. Checks if the voxel size is too small. More... | |
template<class TDerived > | |
Eigen::Vector3i | ComputeVoxelIndex (const Eigen::ArrayBase< TDerived > &pos, const typename TDerived::Scalar &inv_voxel_size) |
template<class TReal , class TFeat , class ACCUMULATOR , class OUTPUT_ALLOCATOR > | |
void | _VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator) |
template<class TReal , class TFeat , class ACCUMULATOR , AccumulationFn FEAT_FN> | |
void | _VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size) |
template<class TReal , class TFeat , class OUTPUT_ALLOCATOR > | |
void | VoxelPooling (size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *inp_features, TReal voxel_size, OUTPUT_ALLOCATOR &output_allocator, AccumulationFn position_fn, AccumulationFn feature_fn) |
template<class TReal , class TFeat > | |
void | VoxelPoolingBackprop (TFeat *features_backprop, size_t num_inp, const TReal *const inp_positions, int in_channels, const TFeat *const inp_features, size_t num_pooled, const TReal *const pooled_positions, const TFeat *const pooled_features_gradient, TReal voxel_size, AccumulationFn position_fn, AccumulationFn feature_fn) |
|
strong |
Coordinate Mapping functions
Enumerator | |
---|---|
BALL_TO_CUBE_RADIAL | |
BALL_TO_CUBE_VOLUME_PRESERVING | |
IDENTITY |
|
strong |
void open3d::ml::impl::_CConvBackropFilterCPU | ( | TReal * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_importance, | ||
size_t | num_indices, | ||
const TIndex * | neighbors_index, | ||
const TReal * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TReal * | out_features_gradient, | ||
bool | normalize | ||
) |
void open3d::ml::impl::_CConvComputeFeaturesCPU | ( | TReal * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TReal * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbor_index, | ||
const TReal * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
bool | normalize | ||
) |
Implementation of CConvComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_CConvTransposeBackpropFilterCPU | ( | TReal * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TReal * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | num_indices, | ||
const TIndex * | neighbors_index, | ||
const TReal * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TReal * | out_features_gradient | ||
) |
Implementation of CConvTransposeBackpropFilterCPU with template parameters for configuration.
void open3d::ml::impl::_CConvTransposeComputeFeaturesCPU | ( | TReal * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TReal * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TReal * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbor_index, | ||
const TReal * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets | ||
) |
Implementation of CConvComputeFeatures with template parameters for configuration.
void open3d::ml::impl::_VoxelPooling | ( | size_t | num_inp, |
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat * | inp_features, | ||
TReal | voxel_size, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
void open3d::ml::impl::_VoxelPoolingBackprop | ( | TFeat * | features_backprop, |
size_t | num_inp, | ||
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat *const | inp_features, | ||
size_t | num_pooled, | ||
const TReal *const | pooled_positions, | ||
const TFeat *const | pooled_features_gradient, | ||
TReal | voxel_size | ||
) |
void open3d::ml::impl::CConvBackpropFilterCPU | ( | TReal * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_importance, | ||
size_t | num_indices, | ||
const TIndex * | neighbors_index, | ||
const TReal * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TReal * | out_features_gradient, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a continuous convolution.
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. This function can make use of more memory and returns the maximum size that can be used in max_temp_size. |
temp_size | The size of the temporary memory in bytes. This is used as an output if temp is nullptr and returns the minimum temp size required. |
max_temp_size | This is used as an output if temp is nullptr and returns the maximum temp size that can be used. |
texture_alignment | The texture alignment in bytes. This is used for allocating segments within the temporary memory. |
filter_backrop | Output array for the computed filter gradient with shape [depth,height,witdth, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the output features are normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvComputeFeaturesCPU | ( | TReal * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TReal * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbor_index, | ||
const TReal * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the output features of a continuous convolution.
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvTransposeBackpropFilterCPU | ( | TReal * | filter_backprop, |
const std::vector< int > & | filter_dims, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TReal * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | num_indices, | ||
const TIndex * | neighbors_index, | ||
const TReal * | neighbors_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
const TReal * | out_features_gradient, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the backprop for the filter of a transpose continuous convolution.
filter_backrop | Output array for the computed filter gradient with shape [depth,height,witdth, inp channels, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
out_features_gradient | The gradient from the features with shape [num_out, out_channels] |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::CConvTransposeComputeFeaturesCPU | ( | TReal * | out_features, |
const std::vector< int > & | filter_dims, | ||
const TReal * | filter, | ||
size_t | num_out, | ||
const TReal * | out_positions, | ||
const TReal * | out_importance, | ||
size_t | num_inp, | ||
const TReal * | inp_positions, | ||
const TReal * | inp_features, | ||
const TReal * | inp_neighbors_importance_sum, | ||
const int64_t * | inp_neighbors_row_splits, | ||
size_t | neighbors_index_size, | ||
const TIndex * | neighbor_index, | ||
const TReal * | neighbor_importance, | ||
const int64_t * | neighbors_row_splits, | ||
const TReal * | extents, | ||
const TReal * | offsets, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Computes the output features of a transpose continuous convolution.
out_features | Output array for the computed features with shape [num_out, out channels] |
filter_dims | The sizes of the filter dimensions. The size of filter_dims must be 5. The order is [depth, height, width, inp channels, out channels]. |
filter | Pointer to the filter values. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
out_importance | Optional importance for each output point with shape [num_out]. Set to null to disable. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_neighbors_importance_sum | The sum of the neighbors_importance values for each input with shape [num_inp]. |
inp_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in inp_neighbors_index . The size of the array is num_inp + 1. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
bool open3d::ml::impl::CheckVoxelSize | ( | std::string & | err, |
const size_t | num_positions, | ||
const T *const | positions, | ||
const T | voxel_size | ||
) |
Function for debugging. Checks if the voxel size is too small.
|
inline |
Computes the filter coordinates. The input to this function are coordinates relative to the point where the convolution is evaluated. Coordinates are usually in the range [-extent/2,extent/2] with extent as the edge length of the bounding box of the filter shape. The output is a coordinate within the filter array, i.e. the range is [0, filter_size.xyz], if the point was inside the filter shape.
The simplest filter shape is a cuboid (MAPPING=IDENTITY) and the transformation is simply [-extent/2,extent/2] -> [0, filter_size.xyz]. The other type of shape that is implemented is a sphere with MAPPING=BALL_TO_CUBE_RADIAL or MAPPING=BALL_TO_CUBE_VOLUME_PRESERVING.
ALIGN_CORNERS | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
MAPPING | The mapping that is applied to the input coordinates.
|
x | x coordinates. Input and output variable. |
y | y coordinates. Input and output variable. |
z | z coordinates. Input and output variable. |
filter_size | The spatial size of the filter array in voxels. |
inv_extents | The reciproval of the spatial extent of the filter in coordinate units. |
offset | An offset for shifting the center. Can be used to implement discrete filters with even filter size. |
|
inline |
Computes an integer voxel index for a 3D position.
pos | A 3D position. |
inv_voxel_size | The reciprocal of the voxel size |
Eigen::Vector3i open3d::ml::impl::ComputeVoxelIndex | ( | const Eigen::ArrayBase< TDerived > & | pos, |
const typename TDerived::Scalar & | inv_voxel_size | ||
) |
Computes an integer voxel index for a 3D position.
pos | A 3D position. |
inv_voxel_size | The reciprocal of the voxel size |
void open3d::ml::impl::FillColumn | ( | const cudaStream_t & | stream, |
TReal * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
const TReal *const __restrict__ | out_positions, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_positions, | ||
const TReal *const __restrict__ | inp_features, | ||
const TReal *const __restrict__ | inp_importance, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TReal *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const TReal *const __restrict__ | extents, | ||
const TReal *const __restrict__ | offsets, | ||
const std::vector< int > & | filter_dims, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
Copies and transforms the features to a column, which can be multiplied with the filter matrix.
TReal | Type for positions and features. |
TIndex | Type for addressing neighbors. |
columns | Output array with shape |
in_channels | Number of input channels. |
begin_idx | Index of the first output point to process. |
end_idx | Index after the last output point to process. |
num_out | The number of output points. |
out_positions | The positions of the output points. The shape is [num_out, 3]. |
num_inp | The number of input points. |
inp_positions | The positions of the input points. The shape is [num_inp, 3]. |
inp_features | The input features with shape [num_inp, in_channels]. |
inp_importance | Optional importance for each input point with shape [num_inp]. Set to null to disable. |
neighbors_index_size | The size of the neighbors_index array. |
neighbors_index | The array with lists of neighbors for each output point. The start and end of each sublist is defined by neighbors_row_splits . |
neighbors_importance | Optional importance for each entry in neighbors_index . Set to null to disable. |
neighbors_row_splits | The prefix sum which defines the start and end of the sublists in neighbors_index . The size of the array is num_out + 1. |
extents | The spatial extents of the filter in coordinate units. extents can be a scalar or a 1D array of shape [num_out] or a 2D array of shape [num_out,3]. The shape depends on individual_extent and isotropic_extent . |
offsets | A single 3D vector used in the filter coordinate computation. The shape is [3]. |
filter_dims | The spatial filter size in voxels. (The filter resolution) with shape [3]. |
interpolation | The interpolation mode. Either LINEAR or NEAREST_NEIGHBOR. |
coordinate_mapping | The coordinate mapping function. One of IDENTITY, BALL_TO_CUBE_RADIAL, BALL_TO_CUBE_VOLUME_PRESERVING. |
align_corners | If true then the voxel centers of the outer voxels of the filter array are mapped to the boundary of the filter shape. If false then the boundary of the filter array is mapped to the boundary of the filter shape. |
individual_extent | If true each output point has an individual extent. |
isotropic_extent | If true each then the extent is isotropic for each output point. |
normalize | If true then the result is normalized either by the number of points (neighbors_importance is null) or by the sum of the respective values in neighbors_importance. |
void open3d::ml::impl::FillColumnTranspose | ( | const cudaStream_t & | stream, |
TReal * | columns, | ||
int | in_channels, | ||
TIndex | begin_idx, | ||
TIndex | end_idx, | ||
TIndex | num_out, | ||
const TReal *const __restrict__ | out_positions, | ||
TIndex | num_inp, | ||
const TReal *const __restrict__ | inp_positions, | ||
const TReal *const __restrict__ | inp_features, | ||
const TReal *const __restrict__ | inp_neighbors_importance_sum, | ||
const int64_t *const __restrict__ | inp_neighbors_prefix_sum, | ||
size_t | neighbors_index_size, | ||
const TIndex *const __restrict__ | neighbors_index, | ||
const TReal *const __restrict__ | neighbors_importance, | ||
const int64_t *const __restrict__ | neighbors_row_splits, | ||
const TReal *const __restrict__ | extents, | ||
const TReal *const __restrict__ | offsets, | ||
const std::vector< int > & | filter_dims, | ||
InterpolationMode | interpolation, | ||
CoordinateMapping | coordinate_mapping, | ||
bool | align_corners, | ||
bool | individual_extent, | ||
bool | isotropic_extent, | ||
bool | normalize | ||
) |
void open3d::ml::impl::FixedRadiusSearchCPU | ( | int64_t * | query_neighbors_row_splits, |
const size_t | num_points, | ||
const T *const | points, | ||
const 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, | ||
const size_t | hash_table_cell_splits_size, | ||
const uint32_t *const | hash_table_cell_splits, | ||
const uint32_t *const | hash_table_index, | ||
const Metric | metric, | ||
const bool | ignore_query_point, | ||
const bool | return_distances, | ||
OUTPUT_ALLOCATOR & | 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.
T | Floating-point data type for the point positions. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
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 must be the array that was used for building the spatial hash table. |
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 | 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 | 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 | 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 BuildSpatialHashTableCPU. The row splits array describing the start and end of each cell. |
hash_table_index | This is an output of the function BuildSpatialHashTableCPU. 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. |
void open3d::ml::impl::InvertNeighborsListCPU | ( | const TIndex *const | inp_neighbors_index, |
const TAttr *const | inp_neighbors_attributes, | ||
const int | num_attributes_per_neighbor, | ||
const int64_t *const | inp_neighbors_row_splits, | ||
const size_t | inp_num_queries, | ||
TIndex * | out_neighbors_index, | ||
TAttr * | out_neighbors_attributes, | ||
const size_t | index_size, | ||
int64_t * | out_neighbors_row_splits, | ||
const size_t | out_num_queries | ||
) |
Inverts a neighbors list, which is a tuple of the form (neighbors_index, neighbors_row_splits, neighbors_attributes). neighbors_index is a nested list of indices to the neighbors. Each entry defines an edge between two indices (points). The neighbors_row_splits defines the start and end of each sublist. neighbors_attributes is an optional array of attributes for each entry in neighbors_index.
Example: The neighbors for point cloud A (3 points) in point cloud B (2 points) is defined by:
The inverted neighbors list is then the neighbors for point cloud B in A
inp_neighbors_index | The nested list of neighbor indices. |
inp_neighbors_attributes | The array of attributes for each entry in inp_neighbors_index . This is optional and can be set to null. |
num_attributes_per_neighbor | The number of scalar attributes for each entry in inp_neighbors_index . |
inp_neighbors_row_splits | Defines the start and end of the sublists in inp_neighbors_index . This is an exclusive prefix sum with 0 as the first element and the length of inp_neighbors_index as last element. The size is inp_num_queries + 1 |
inp_num_queries | The number of queries. |
out_neighbors_index | The inverted neighbors_index list with the same size as inp_neighbors_index . |
out_neighbors_attributes | The inverted array of attributes with the same size as inp_neighbors_attributes . |
index_size | This is the size of inp_neighbors_index and out_neighbors_index , both have the same size. |
out_neighbors_row_splits | The prefix sum which defines the start and end of the sublists in out_neighbors_index . |
out_num_queries | The number of queries with respect to the inverted neighbors list. |
void open3d::ml::impl::KnnSearchCPU | ( | int64_t * | query_neighbors_row_splits, |
size_t | num_points, | ||
const T *const | points, | ||
size_t | num_queries, | ||
const T *const | queries, | ||
const int | k, | ||
const Metric | metric, | ||
const bool | ignore_query_point, | ||
const bool | return_distances, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
KNN 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 each 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. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
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 . |
k | The number of neighbors to search. |
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 |
Maps coordinates in a cylinder with radius 1 to a cube. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.
|
inline |
Maps coordinates in a sphere with radius 1 to a cylinder. The input and output range of the coordinates is [-1,1]. The cylinder axis is along z.
void open3d::ml::impl::MultiplyAndCopyColumns | ( | const cudaStream_t & | stream, |
size_t | rows, | ||
size_t | cols, | ||
T *__restrict__ | out_ptr, | ||
const T *const __restrict__ | col_major_matrix, | ||
const T *const __restrict__ | vector | ||
) |
Multiplies each column with a scalar.
out_ptr | Output pointer |
col_major_matrix | Matrix with shape [rows, cols] in column major storage oder. |
vector | A vector with shape [cols]. |
void open3d::ml::impl::MultiplyColumns | ( | const cudaStream_t & | stream, |
size_t | rows, | ||
size_t | cols, | ||
T *__restrict__ | col_major_matrix, | ||
const T *const __restrict__ | vector | ||
) |
Multiplies each column with a scalar in-place.
col_major_matrix | Matrix with shape [rows, cols] in column major storage oder. |
vector | A vector with shape [cols]. |
void open3d::ml::impl::RadiusSearchCPU | ( | int64_t * | query_neighbors_row_splits, |
size_t | num_points, | ||
const T *const | points, | ||
size_t | num_queries, | ||
const T *const | queries, | ||
const T * | radii, | ||
const Metric | metric, | ||
const bool | ignore_query_point, | ||
const bool | return_distances, | ||
const bool | normalize_distances, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
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 each 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. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
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 . |
radii | A vector of search radii with length num_queries . |
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!! |
normalize_distances | If true then the returned distances are normalized in the range [0,1]. Note that for L2 the normalized distance is squared. |
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. |
void open3d::ml::impl::RaggedToDenseCPU | ( | const T *const | values, |
const int64_t *const | row_splits, | ||
const size_t | row_splits_size, | ||
const size_t | out_col_size, | ||
const T *const | default_value, | ||
const size_t | default_value_size, | ||
T * | out_values | ||
) |
Creates a dense tensor from a ragged tensor.
Example where each value has size 2: values = [[0,0],[1,1],[2,2],[3,3],[4,4]] row_splits = [0,2,5] out_col_size=3 default_value=[-1,-1] default_value_size = 2
will return
out_values = [[[0,0],[1,1],[-1,-1]], [[2,2],[3,3],[4,4]]]
values | Linear memory with all values. |
row_splits | Defines the start and end of each entry in the ragged tensor. This is an exclusive prefix sum with 0 as the first element and the length of all values as the last element. |
row_splits_size | The length of the row_splits vector. |
out_col_size | The output column size. This is the second dim of the dense output tensor. |
default_value | The default value to use if there are not enough values for filling the row. |
default_value_size | The size of the default value. |
out_values | This is the output array. The size of the array must be [row_splits_size-1, out_col_size, default_value_size]. |
void open3d::ml::impl::ReduceSubarraysSumCPU | ( | const T *const | values, |
const size_t | values_size, | ||
const int64_t *const | row_splits, | ||
const size_t | num_arrays, | ||
T * | out_sums | ||
) |
Reduces subarrays in linear memory with the sum operation. The sum for empty subarrays is 0.
values | The linear array with all values |
values_size | Number of elements of values |
row_splits | Defines the start and end of each subarray. This is an exclusive prefix sum with 0 as the first element and the length of values as last element. The size is num_arrays + 1 |
num_arrays | The number of subarrays |
out_sums | The preallocated output array with size num_arrays |
|
inline |
Spatial hashing function for integer coordinates.
|
inline |
void open3d::ml::impl::VoxelizeCPU | ( | size_t | num_points, |
const T *const | points, | ||
const T *const | voxel_size, | ||
const T *const | points_range_min, | ||
const T *const | points_range_max, | ||
const int64_t | max_points_per_voxel, | ||
const int64_t | max_voxels, | ||
OUTPUT_ALLOCATOR & | output_allocator | ||
) |
This function voxelizes a point cloud. The function returns the integer coordinates of the voxels that contain points and a compact list of the indices that associate the voxels to the points.
T | Floating-point data type for the point positions. |
NDIM | The number of dimensions of the points. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
num_points | The number of points. |
points | Array with the point positions. The shape is [num_points,NDIM]. |
voxel_size | The edge lenghts of the voxel. The shape is [NDIM] |
points_range_min | The lower bound of the domain to be voxelized. The shape is [NDIM]. |
points_range_max | The upper bound of the domain to be voxelized. The shape is [NDIM]. |
max_points_per_voxel | This parameter limits the number of points that are recorderd for each voxel. |
max_voxels | This parameter limits the number of voxels that will be generated. |
output_allocator | An object that implements functions for allocating the output arrays. The object must implement functions AllocVoxelCoords(int32_t** ptr, int64_t rows, int64_t cols), AllocVoxelPointIndices(int64_t** ptr, int64_t size), and AllocVoxelPointRowSplits(int64_t** ptr, int64_t size). All functions should allocate memory and return a pointer to that memory in ptr. The argments size, rows, and cols define the size of the array as the number of elements. All functions must accept zero size arguments. In this case ptr does not need to be set. |
void open3d::ml::impl::VoxelPooling | ( | size_t | num_inp, |
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat * | inp_features, | ||
TReal | voxel_size, | ||
OUTPUT_ALLOCATOR & | output_allocator, | ||
AccumulationFn | position_fn, | ||
AccumulationFn | feature_fn | ||
) |
Pooling operation for point clouds. Aggregates points that are inside the same voxel.
TReal | Scalar type for point positions. |
TFeat | Scalar type for the features. |
OUTPUT_ALLOCATOR | Type of the output_allocator. See output_allocator for more information. |
num_inp | The number of input points. |
inp_positions | Array with 3D point positions. |
in_channels | The number of input feature channels. |
inp_features | The array with the point features. The shape is [num_inp, in_channels]. |
voxel_size | The voxel size (voxel edge length) used for pooling. |
output_allocator | An object that implements functions for allocating the output arrays. The object must implement functions AllocPooledPositions(TReal** ptr, size_t num) and AllocPooledFeatures(TFeat** ptr, size_t num, channels), with 'num' as the number of output points and 'channels' as in_channels . Both functions should allocate memory and return a pointer to that memory in ptr. Both functions must accept the argument num==0. In this case ptr does not need to be set. Note that AllocPooledPositions must allocate memory for num*3*sizeof(TReal) bytes. |
position_fn | Defines how the new point positions will be computed. AVERAGE computes the center of gravity for the points within one voxel. NEAREST_NEIGHBOR selects the point closest to the voxel center. CENTER uses the voxel center for the position of the generated point. |
feature_fn | Defines how the new features will be computed. AVERAGE computes the average feature vector. NEAREST_NEIGHBOR selects the feature vector of the point closest to the voxel center. MAX uses the maximum feature among all points within the voxel. |
void open3d::ml::impl::VoxelPoolingBackprop | ( | TFeat * | features_backprop, |
size_t | num_inp, | ||
const TReal *const | inp_positions, | ||
int | in_channels, | ||
const TFeat *const | inp_features, | ||
size_t | num_pooled, | ||
const TReal *const | pooled_positions, | ||
const TFeat *const | pooled_features_gradient, | ||
TReal | voxel_size, | ||
AccumulationFn | position_fn, | ||
AccumulationFn | feature_fn | ||
) |
Backpropagation to the features for VoxelPooling.
features_backprop | The output array with the gradients for the features. |
num_pooled | The number of points after pooling with VoxelPooling . |
pooled_positions | Array with the 3D positions after pooling. |
pooled_features_gradient | Array with the point features after pooling. |
See VoxelPooling
for the description of the remaining parameters.