Open3D (C++ API)  0.18.0+5c982c7
Public Member Functions | Protected Attributes
open3d::core::nns::NNSIndex Class Referenceabstract

#include <NNSIndex.h>

Inheritance diagram for open3d::core::nns::NNSIndex:
open3d::core::nns::FixedRadiusIndex open3d::core::nns::KnnIndex open3d::core::nns::NanoFlannIndex

Public Member Functions

 NNSIndex ()
 Default Constructor. More...
 
virtual ~NNSIndex ()
 
 NNSIndex (const NNSIndex &)=delete
 
NNSIndexoperator= (const NNSIndex &)=delete
 
virtual bool SetTensorData (const Tensor &dataset_points, const Dtype &index_dtype)=0
 
virtual bool SetTensorData (const Tensor &dataset_points, double radius, const Dtype &index_dtype)=0
 
virtual std::pair< Tensor, TensorSearchKnn (const Tensor &query_points, int knn) const =0
 
virtual std::tuple< Tensor, Tensor, TensorSearchRadius (const Tensor &query_points, const Tensor &radii, bool sort) const =0
 
virtual std::tuple< Tensor, Tensor, TensorSearchRadius (const Tensor &query_points, double radius, bool sort) const =0
 
virtual std::tuple< Tensor, Tensor, TensorSearchHybrid (const Tensor &query_points, double radius, int max_knn) const =0
 
int GetDimension () const
 
size_t GetDatasetSize () const
 
Dtype GetDtype () const
 
Device GetDevice () const
 
Dtype GetIndexDtype () const
 

Protected Attributes

Tensor dataset_points_
 
Dtype index_dtype_
 

Constructor & Destructor Documentation

◆ NNSIndex() [1/2]

open3d::core::nns::NNSIndex::NNSIndex ( )
inline

Default Constructor.

◆ ~NNSIndex()

virtual open3d::core::nns::NNSIndex::~NNSIndex ( )
inlinevirtual

◆ NNSIndex() [2/2]

open3d::core::nns::NNSIndex::NNSIndex ( const NNSIndex )
delete

Member Function Documentation

◆ GetDatasetSize()

size_t open3d::core::nns::NNSIndex::GetDatasetSize ( ) const

Get size of the dataset points.

Returns
number of points in dataset.

◆ GetDevice()

Device open3d::core::nns::NNSIndex::GetDevice ( ) const

Get device of the dataset points.

Returns
device of dataset points.

◆ GetDimension()

int open3d::core::nns::NNSIndex::GetDimension ( ) const

Get dimension of the dataset points.

Returns
dimension of dataset points.

◆ GetDtype()

Dtype open3d::core::nns::NNSIndex::GetDtype ( ) const

Get dtype of the dataset points.

Returns
dtype of dataset points.

◆ GetIndexDtype()

Dtype open3d::core::nns::NNSIndex::GetIndexDtype ( ) const

Get dtype of indices.

Returns
dtype of indices.

◆ operator=()

NNSIndex& open3d::core::nns::NNSIndex::operator= ( const NNSIndex )
delete

◆ SearchHybrid()

virtual std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::NNSIndex::SearchHybrid ( const Tensor query_points,
double  radius,
int  max_knn 
) const
pure virtual

Perform hybrid search.

Parameters
query_pointsQuery points. Must be 2D, with shape {n, d}.
radiusRadius.
max_knnMaximum number of neighbor to search per query point.
Returns
Tuple of Tensors, (indices, distances, counts):
  • indices: Tensor of shape {n, knn}, with dtype Int32.
  • distances: Tensor of shape {n, knn}, with dtype Float32.
  • counts: Tensor of shape {n, 1}, with dtype Int32.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::FixedRadiusIndex, and open3d::core::nns::KnnIndex.

◆ SearchKnn()

virtual std::pair<Tensor, Tensor> open3d::core::nns::NNSIndex::SearchKnn ( const Tensor query_points,
int  knn 
) const
pure virtual

Perform K nearest neighbor search.

Parameters
query_pointsQuery points. Must be 2D, with shape {n, d}, same dtype with dataset_points.
knnNumber of nearest neighbor to search.
Returns
Pair of Tensors: (indices, distances):
  • indices: Tensor of shape {n, knn}, with dtype Int32.
  • distances: Tensor of shape {n, knn}, same dtype with dataset_points.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::KnnIndex, and open3d::core::nns::FixedRadiusIndex.

◆ SearchRadius() [1/2]

virtual std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::NNSIndex::SearchRadius ( const Tensor query_points,
const Tensor radii,
bool  sort 
) const
pure virtual

Perform radius search with multiple radii.

Parameters
query_pointsQuery points. Must be 2D, with shape {n, d}, same dtype with dataset_points.
radiilist of radius. Must be 1D, with shape {n, }.
Returns
Tuple of Tensors: (indices, distances, num_neighbors):
  • indices: Tensor of shape {total_num_neighbors,}, dtype Int32.
  • distances: Tensor of shape {total_num_neighbors,}, same dtype with dataset_points.
  • num_neighbors: Tensor of shape {n,}, dtype Int32.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::FixedRadiusIndex, and open3d::core::nns::KnnIndex.

◆ SearchRadius() [2/2]

virtual std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::NNSIndex::SearchRadius ( const Tensor query_points,
double  radius,
bool  sort 
) const
pure virtual

Perform radius search.

Parameters
query_pointsQuery points. Must be 2D, with shape {n, d}, same dtype with dataset_points.
radiusRadius.
Returns
Tuple of Tensors, (indices, distances, num_neighbors):
  • indices: Tensor of shape {total_num_neighbors,}, dtype Int32.
  • distances: Tensor of shape {total_num_neighbors,}, same dtype with dataset_points.
  • num_neighbors: Tensor of shape {n}, dtype Int32.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::FixedRadiusIndex, and open3d::core::nns::KnnIndex.

◆ SetTensorData() [1/2]

virtual bool open3d::core::nns::NNSIndex::SetTensorData ( const Tensor dataset_points,
const Dtype index_dtype 
)
pure virtual

Set the data for the nearest neighbor search.

Parameters
dataset_pointsDataset points for KDTree construction. Must be 2D, with shape {n, d}.
Returns
Returns true if the construction success, otherwise false.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::KnnIndex, and open3d::core::nns::FixedRadiusIndex.

◆ SetTensorData() [2/2]

virtual bool open3d::core::nns::NNSIndex::SetTensorData ( const Tensor dataset_points,
double  radius,
const Dtype index_dtype 
)
pure virtual

Set the data for the nearest neighbor search.

Parameters
dataset_pointsDataset points for KDTree construction. Must be 2D, with shape {n, d}.
Returns
Returns true if the construction success, otherwise false.

Implemented in open3d::core::nns::NanoFlannIndex, open3d::core::nns::KnnIndex, and open3d::core::nns::FixedRadiusIndex.

Field Documentation

◆ dataset_points_

Tensor open3d::core::nns::NNSIndex::dataset_points_
protected

◆ index_dtype_

Dtype open3d::core::nns::NNSIndex::index_dtype_
protected

The documentation for this class was generated from the following files: