Open3D (C++ API)
0.19.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
open3d
core
nns
KnnIndex.h
Go to the documentation of this file.
1
// ----------------------------------------------------------------------------
2
// - Open3D: www.open3d.org -
3
// ----------------------------------------------------------------------------
4
// Copyright (c) 2018-2024 www.open3d.org
5
// SPDX-License-Identifier: MIT
6
// ----------------------------------------------------------------------------
7
8
#pragma once
9
10
#include "
open3d/core/Dtype.h
"
11
#include "
open3d/core/Tensor.h
"
12
#include "
open3d/core/nns/NNSIndex.h
"
13
#include "
open3d/core/nns/NeighborSearchCommon.h
"
14
#include "
open3d/utility/Logging.h
"
15
16
namespace
open3d
{
17
namespace
core
{
18
namespace
nns
{
19
20
#ifdef BUILD_CUDA_MODULE
21
template
<
class
T,
class
TIndex>
22
void
KnnSearchCUDA(
const
Tensor& points,
23
const
Tensor& points_row_splits,
24
const
Tensor& queries,
25
const
Tensor& queries_row_splits,
26
int
knn,
27
Tensor& neighbors_index,
28
Tensor& neighbors_row_splits,
29
Tensor& neighbors_distance);
30
#endif
31
32
class
KnnIndex
:
public
NNSIndex
{
33
public
:
34
KnnIndex
();
35
40
KnnIndex
(
const
Tensor
& dataset_points);
41
KnnIndex
(
const
Tensor
& dataset_points,
const
Dtype
& index_dtype);
42
~KnnIndex
();
43
KnnIndex
(
const
KnnIndex
&) =
delete
;
44
KnnIndex
&
operator=
(
const
KnnIndex
&) =
delete
;
45
46
public
:
47
bool
SetTensorData
(
const
Tensor
& dataset_points,
48
const
Dtype
& index_dtype =
core::Int64
)
override
;
49
bool
SetTensorData
(
const
Tensor
& dataset_points,
50
const
Tensor
& points_row_splits,
51
const
Dtype
& index_dtype =
core::Int64
);
52
bool
SetTensorData
(
const
Tensor
& dataset_points,
53
double
radius,
54
const
Dtype
& index_dtype =
core::Int64
)
override
{
55
utility::LogError(
56
"[KnnIndex::SetTensorData with radius not implemented."
);
57
}
58
59
std::pair<Tensor, Tensor>
SearchKnn
(
const
Tensor
& query_points,
60
int
knn)
const override
;
61
62
std::pair<Tensor, Tensor>
SearchKnn
(
const
Tensor
& query_points,
63
const
Tensor
& queries_row_splits,
64
int
knn)
const
;
65
66
std::tuple<Tensor, Tensor, Tensor>
SearchRadius
(
const
Tensor
& query_points,
67
const
Tensor
& radii,
68
bool
sort)
const override
{
69
utility::LogError(
"KnnIndex::SearchRadius not implemented."
);
70
}
71
72
std::tuple<Tensor, Tensor, Tensor>
SearchRadius
(
const
Tensor
& query_points,
73
const
double
radius,
74
bool
sort)
const override
{
75
utility::LogError(
"KnnIndex::SearchRadius not implemented."
);
76
}
77
78
std::tuple<Tensor, Tensor, Tensor>
SearchHybrid
(
79
const
Tensor
& query_points,
80
const
double
radius,
81
const
int
max_knn)
const override
{
82
utility::LogError(
"KnnIndex::SearchHybrid not implemented."
);
83
}
84
85
protected
:
86
Tensor
points_row_splits_
;
87
};
88
89
}
// namespace nns
90
}
// namespace core
91
}
// namespace open3d
Dtype.h
Logging.h
NNSIndex.h
Tensor.h
open3d::core::Dtype
Definition
Dtype.h:20
open3d::core::Tensor
Definition
Tensor.h:32
open3d::core::nns::KnnIndex::SearchKnn
std::pair< Tensor, Tensor > SearchKnn(const Tensor &query_points, int knn) const override
Definition
KnnIndex.cpp:79
open3d::core::nns::KnnIndex::SearchRadius
std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, const double radius, bool sort) const override
Definition
KnnIndex.h:72
open3d::core::nns::KnnIndex::KnnIndex
KnnIndex(const KnnIndex &)=delete
open3d::core::nns::KnnIndex::KnnIndex
KnnIndex()
Definition
KnnIndex.cpp:19
open3d::core::nns::KnnIndex::SearchHybrid
std::tuple< Tensor, Tensor, Tensor > SearchHybrid(const Tensor &query_points, const double radius, const int max_knn) const override
Definition
KnnIndex.h:78
open3d::core::nns::KnnIndex::SetTensorData
bool SetTensorData(const Tensor &dataset_points, const Dtype &index_dtype=core::Int64) override
Definition
KnnIndex.cpp:31
open3d::core::nns::KnnIndex::operator=
KnnIndex & operator=(const KnnIndex &)=delete
open3d::core::nns::KnnIndex::points_row_splits_
Tensor points_row_splits_
Definition
KnnIndex.h:86
open3d::core::nns::KnnIndex::~KnnIndex
~KnnIndex()
Definition
KnnIndex.cpp:29
open3d::core::nns::KnnIndex::SetTensorData
bool SetTensorData(const Tensor &dataset_points, double radius, const Dtype &index_dtype=core::Int64) override
Definition
KnnIndex.h:52
open3d::core::nns::KnnIndex::SearchRadius
std::tuple< Tensor, Tensor, Tensor > SearchRadius(const Tensor &query_points, const Tensor &radii, bool sort) const override
Definition
KnnIndex.h:66
open3d::core::nns::NNSIndex::NNSIndex
NNSIndex()
Default Constructor.
Definition
NNSIndex.h:24
NeighborSearchCommon.h
open3d::core::nns
Definition
FixedRadiusIndex.cpp:16
open3d::core
Definition
AdvancedIndexing.cpp:15
open3d::core::Int64
const Dtype Int64
Definition
Dtype.cpp:47
open3d
Definition
PinholeCameraIntrinsic.cpp:16
Generated by
1.17.0