Open3D (C++ API)  0.18.0+80ae047
Public Member Functions | Protected Attributes
open3d::core::nns::KnnIndex Class Reference

#include <KnnIndex.h>

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

Public Member Functions

 KnnIndex ()
 
 KnnIndex (const Tensor &dataset_points)
 Parameterized Constructor. More...
 
 KnnIndex (const Tensor &dataset_points, const Dtype &index_dtype)
 
 ~KnnIndex ()
 
 KnnIndex (const KnnIndex &)=delete
 
KnnIndexoperator= (const KnnIndex &)=delete
 
bool SetTensorData (const Tensor &dataset_points, const Dtype &index_dtype=core::Int64) override
 
bool SetTensorData (const Tensor &dataset_points, const Tensor &points_row_splits, const Dtype &index_dtype=core::Int64)
 
bool SetTensorData (const Tensor &dataset_points, double radius, const Dtype &index_dtype=core::Int64) override
 
std::pair< Tensor, TensorSearchKnn (const Tensor &query_points, int knn) const override
 
std::pair< Tensor, TensorSearchKnn (const Tensor &query_points, const Tensor &queries_row_splits, int knn) const
 
std::tuple< Tensor, Tensor, TensorSearchRadius (const Tensor &query_points, const Tensor &radii, bool sort) const override
 
std::tuple< Tensor, Tensor, TensorSearchRadius (const Tensor &query_points, const double radius, bool sort) const override
 
std::tuple< Tensor, Tensor, TensorSearchHybrid (const Tensor &query_points, const double radius, const int max_knn) const override
 
- Public Member Functions inherited from open3d::core::nns::NNSIndex
 NNSIndex ()
 Default Constructor. More...
 
virtual ~NNSIndex ()
 
 NNSIndex (const NNSIndex &)=delete
 
NNSIndexoperator= (const NNSIndex &)=delete
 
int GetDimension () const
 
size_t GetDatasetSize () const
 
Dtype GetDtype () const
 
Device GetDevice () const
 
Dtype GetIndexDtype () const
 

Protected Attributes

Tensor points_row_splits_
 
- Protected Attributes inherited from open3d::core::nns::NNSIndex
Tensor dataset_points_
 
Dtype index_dtype_
 

Constructor & Destructor Documentation

◆ KnnIndex() [1/4]

open3d::core::nns::KnnIndex::KnnIndex ( )

◆ KnnIndex() [2/4]

open3d::core::nns::KnnIndex::KnnIndex ( const Tensor dataset_points)

Parameterized Constructor.

Parameters
dataset_pointsProvides a set of data points as Tensor for KDTree construction.

◆ KnnIndex() [3/4]

open3d::core::nns::KnnIndex::KnnIndex ( const Tensor dataset_points,
const Dtype index_dtype 
)

◆ ~KnnIndex()

open3d::core::nns::KnnIndex::~KnnIndex ( )

◆ KnnIndex() [4/4]

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

Member Function Documentation

◆ operator=()

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

◆ SearchHybrid()

std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::KnnIndex::SearchHybrid ( const Tensor query_points,
const double  radius,
const int  max_knn 
) const
inlineoverridevirtual

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.

Implements open3d::core::nns::NNSIndex.

◆ SearchKnn() [1/2]

std::pair< Tensor, Tensor > open3d::core::nns::KnnIndex::SearchKnn ( const Tensor query_points,
const Tensor queries_row_splits,
int  knn 
) const

◆ SearchKnn() [2/2]

std::pair< Tensor, Tensor > open3d::core::nns::KnnIndex::SearchKnn ( const Tensor query_points,
int  knn 
) const
overridevirtual

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.
  • distainces: Tensor of shape {n, knn}, same dtype with dataset_points.

Implements open3d::core::nns::NNSIndex.

◆ SearchRadius() [1/2]

std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::KnnIndex::SearchRadius ( const Tensor query_points,
const double  radius,
bool  sort 
) const
inlineoverridevirtual

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):
  • indicecs: 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.

Implements open3d::core::nns::NNSIndex.

◆ SearchRadius() [2/2]

std::tuple<Tensor, Tensor, Tensor> open3d::core::nns::KnnIndex::SearchRadius ( const Tensor query_points,
const Tensor radii,
bool  sort 
) const
inlineoverridevirtual

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):
  • indicecs: 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.

Implements open3d::core::nns::NNSIndex.

◆ SetTensorData() [1/3]

bool open3d::core::nns::KnnIndex::SetTensorData ( const Tensor dataset_points,
const Dtype index_dtype = core::Int64 
)
overridevirtual

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.

Implements open3d::core::nns::NNSIndex.

◆ SetTensorData() [2/3]

bool open3d::core::nns::KnnIndex::SetTensorData ( const Tensor dataset_points,
const Tensor points_row_splits,
const Dtype index_dtype = core::Int64 
)

◆ SetTensorData() [3/3]

bool open3d::core::nns::KnnIndex::SetTensorData ( const Tensor dataset_points,
double  radius,
const Dtype index_dtype = core::Int64 
)
inlineoverridevirtual

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.

Implements open3d::core::nns::NNSIndex.

Field Documentation

◆ points_row_splits_

Tensor open3d::core::nns::KnnIndex::points_row_splits_
protected

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