Open3D (C++ API)  0.18.0
PointCloud.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <unordered_map>
11 
12 #include "open3d/core/Tensor.h"
13 
14 namespace open3d {
15 namespace t {
16 namespace geometry {
17 namespace kernel {
18 namespace pointcloud {
19 
20 void Unproject(const core::Tensor& depth,
21  utility::optional<std::reference_wrapper<const core::Tensor>>
22  image_colors,
23  core::Tensor& points,
24  utility::optional<std::reference_wrapper<core::Tensor>> colors,
25  const core::Tensor& intrinsics,
26  const core::Tensor& extrinsics,
27  float depth_scale,
28  float depth_max,
29  int64_t stride);
30 
31 void Project(
32  core::Tensor& depth,
33  utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
34  const core::Tensor& points,
35  utility::optional<std::reference_wrapper<const core::Tensor>> colors,
36  const core::Tensor& intrinsics,
37  const core::Tensor& extrinsics,
38  float depth_scale,
39  float depth_max);
40 
41 void GetPointMaskWithinAABB(const core::Tensor& points,
42  const core::Tensor& min_bound,
43  const core::Tensor& max_bound,
44  core::Tensor& mask);
45 
46 void GetPointMaskWithinOBB(const core::Tensor& points,
47  const core::Tensor& center,
48  const core::Tensor& rotation,
49  const core::Tensor& extent,
50  core::Tensor& mask);
51 
52 void UnprojectCPU(
53  const core::Tensor& depth,
54  utility::optional<std::reference_wrapper<const core::Tensor>>
55  image_colors,
56  core::Tensor& points,
57  utility::optional<std::reference_wrapper<core::Tensor>> colors,
58  const core::Tensor& intrinsics,
59  const core::Tensor& extrinsics,
60  float depth_scale,
61  float depth_max,
62  int64_t stride);
63 
64 void ProjectCPU(
65  core::Tensor& depth,
66  utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
67  const core::Tensor& points,
68  utility::optional<std::reference_wrapper<const core::Tensor>> colors,
69  const core::Tensor& intrinsics,
70  const core::Tensor& extrinsics,
71  float depth_scale,
72  float depth_max);
73 
74 void GetPointMaskWithinAABBCPU(const core::Tensor& points,
75  const core::Tensor& min_bound,
76  const core::Tensor& max_bound,
77  core::Tensor& mask);
78 
79 void GetPointMaskWithinOBBCPU(const core::Tensor& points,
80  const core::Tensor& center,
81  const core::Tensor& rotation,
82  const core::Tensor& extent,
83  core::Tensor& mask);
84 
85 void NormalizeNormalsCPU(core::Tensor& normals);
86 
87 void OrientNormalsToAlignWithDirectionCPU(core::Tensor& normals,
88  const core::Tensor& direction);
89 
90 void OrientNormalsTowardsCameraLocationCPU(const core::Tensor& points,
91  core::Tensor& normals,
92  const core::Tensor& camera);
93 
94 void ComputeBoundaryPointsCPU(const core::Tensor& points,
95  const core::Tensor& normals,
96  const core::Tensor& indices,
97  const core::Tensor& counts,
98  core::Tensor& mask,
99  double angle_threshold);
100 
101 #ifdef BUILD_CUDA_MODULE
102 void UnprojectCUDA(
103  const core::Tensor& depth,
104  utility::optional<std::reference_wrapper<const core::Tensor>>
105  image_colors,
106  core::Tensor& points,
107  utility::optional<std::reference_wrapper<core::Tensor>> colors,
108  const core::Tensor& intrinsics,
109  const core::Tensor& extrinsics,
110  float depth_scale,
111  float depth_max,
112  int64_t stride);
113 
114 void ProjectCUDA(
115  core::Tensor& depth,
116  utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
117  const core::Tensor& points,
118  utility::optional<std::reference_wrapper<const core::Tensor>> colors,
119  const core::Tensor& intrinsics,
120  const core::Tensor& extrinsics,
121  float depth_scale,
122  float depth_max);
123 
124 void GetPointMaskWithinAABBCUDA(const core::Tensor& points,
125  const core::Tensor& min_bound,
126  const core::Tensor& max_bound,
127  core::Tensor& mask);
128 
129 void GetPointMaskWithinOBBCUDA(const core::Tensor& points,
130  const core::Tensor& center,
131  const core::Tensor& rotation,
132  const core::Tensor& extent,
133  core::Tensor& mask);
134 
135 void NormalizeNormalsCUDA(core::Tensor& normals);
136 
137 void OrientNormalsToAlignWithDirectionCUDA(core::Tensor& normals,
138  const core::Tensor& direction);
139 
140 void OrientNormalsTowardsCameraLocationCUDA(const core::Tensor& points,
141  core::Tensor& normals,
142  const core::Tensor& camera);
143 
144 void ComputeBoundaryPointsCUDA(const core::Tensor& points,
145  const core::Tensor& normals,
146  const core::Tensor& indices,
147  const core::Tensor& counts,
148  core::Tensor& mask,
149  double angle_threshold);
150 #endif
151 
152 void EstimateCovariancesUsingHybridSearchCPU(const core::Tensor& points,
153  core::Tensor& covariances,
154  const double& radius,
155  const int64_t& max_nn);
156 
157 void EstimateCovariancesUsingKNNSearchCPU(const core::Tensor& points,
158  core::Tensor& covariances,
159  const int64_t& max_nn);
160 
161 void EstimateCovariancesUsingRadiusSearchCPU(const core::Tensor& points,
162  core::Tensor& covariances,
163  const double& radius);
164 
165 void EstimateNormalsFromCovariancesCPU(const core::Tensor& covariances,
166  core::Tensor& normals,
167  const bool has_normals);
168 
169 void EstimateColorGradientsUsingHybridSearchCPU(const core::Tensor& points,
170  const core::Tensor& normals,
171  const core::Tensor& colors,
172  core::Tensor& color_gradient,
173  const double& radius,
174  const int64_t& max_nn);
175 
176 void EstimateColorGradientsUsingKNNSearchCPU(const core::Tensor& points,
177  const core::Tensor& normals,
178  const core::Tensor& colors,
179  core::Tensor& color_gradient,
180  const int64_t& max_nn);
181 
182 void EstimateColorGradientsUsingRadiusSearchCPU(const core::Tensor& points,
183  const core::Tensor& normals,
184  const core::Tensor& colors,
185  core::Tensor& color_gradient,
186  const double& radius);
187 
188 #ifdef BUILD_CUDA_MODULE
189 void EstimateCovariancesUsingHybridSearchCUDA(const core::Tensor& points,
190  core::Tensor& covariances,
191  const double& radius,
192  const int64_t& max_nn);
193 
194 void EstimateCovariancesUsingKNNSearchCUDA(const core::Tensor& points,
195  core::Tensor& covariances,
196  const int64_t& max_nn);
197 
198 void EstimateCovariancesUsingRadiusSearchCUDA(const core::Tensor& points,
199  core::Tensor& covariances,
200  const double& radius);
201 
202 void EstimateNormalsFromCovariancesCUDA(const core::Tensor& covariances,
203  core::Tensor& normals,
204  const bool has_normals);
205 
206 void EstimateColorGradientsUsingHybridSearchCUDA(const core::Tensor& points,
207  const core::Tensor& normals,
208  const core::Tensor& colors,
209  core::Tensor& color_gradient,
210  const double& radius,
211  const int64_t& max_nn);
212 
213 void EstimateColorGradientsUsingKNNSearchCUDA(const core::Tensor& points,
214  const core::Tensor& normals,
215  const core::Tensor& colors,
216  core::Tensor& color_gradient,
217  const int64_t& max_nn);
218 
219 void EstimateColorGradientsUsingRadiusSearchCUDA(const core::Tensor& points,
220  const core::Tensor& normals,
221  const core::Tensor& colors,
222  core::Tensor& color_gradient,
223  const double& radius);
224 #endif
225 
226 } // namespace pointcloud
227 } // namespace kernel
228 } // namespace geometry
229 } // namespace t
230 } // namespace open3d
size_t stride
Definition: TriangleMeshBuffers.cpp:165
bool has_normals
Definition: FilePCD.cpp:61
int points
Definition: FilePCD.cpp:54
void EstimateCovariancesUsingHybridSearchCPU(const core::Tensor &points, core::Tensor &covariances, const double &radius, const int64_t &max_nn)
Definition: PointCloudImpl.h:562
void GetPointMaskWithinAABB(const core::Tensor &points, const core::Tensor &min_bound, const core::Tensor &max_bound, core::Tensor &mask)
Definition: PointCloud.cpp:100
void EstimateCovariancesUsingRadiusSearchCPU(const core::Tensor &points, core::Tensor &covariances, const double &radius)
Definition: PointCloudImpl.h:612
void UnprojectCPU(const core::Tensor &depth, utility::optional< std::reference_wrapper< const core::Tensor >> image_colors, core::Tensor &points, utility::optional< std::reference_wrapper< core::Tensor >> colors, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale, float depth_max, int64_t stride)
Definition: PointCloudImpl.h:45
void EstimateNormalsFromCovariancesCPU(const core::Tensor &covariances, core::Tensor &normals, const bool has_normals)
Definition: PointCloudImpl.h:979
void OrientNormalsTowardsCameraLocationCPU(const core::Tensor &points, core::Tensor &normals, const core::Tensor &camera)
Definition: PointCloudImpl.h:286
void ProjectCPU(core::Tensor &depth, utility::optional< std::reference_wrapper< core::Tensor >> image_colors, const core::Tensor &points, utility::optional< std::reference_wrapper< const core::Tensor >> colors, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale, float depth_max)
Definition: PointCloudCPU.cpp:18
void GetPointMaskWithinAABBCPU(const core::Tensor &points, const core::Tensor &min_bound, const core::Tensor &max_bound, core::Tensor &mask)
Definition: PointCloudImpl.h:143
void ComputeBoundaryPointsCPU(const core::Tensor &points, const core::Tensor &normals, const core::Tensor &indices, const core::Tensor &counts, core::Tensor &mask, double angle_threshold)
Definition: PointCloudImpl.h:421
void EstimateColorGradientsUsingKNNSearchCPU(const core::Tensor &points, const core::Tensor &normals, const core::Tensor &colors, core::Tensor &color_gradient, const int64_t &max_nn)
Definition: PointCloudImpl.h:1185
void Unproject(const core::Tensor &depth, utility::optional< std::reference_wrapper< const core::Tensor >> image_colors, core::Tensor &points, utility::optional< std::reference_wrapper< core::Tensor >> colors, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale, float depth_max, int64_t stride)
Definition: PointCloud.cpp:23
void NormalizeNormalsCPU(core::Tensor &normals)
Definition: PointCloudImpl.h:221
void Project(core::Tensor &depth, utility::optional< std::reference_wrapper< core::Tensor >> image_colors, const core::Tensor &points, utility::optional< std::reference_wrapper< const core::Tensor >> colors, const core::Tensor &intrinsics, const core::Tensor &extrinsics, float depth_scale, float depth_max)
Definition: PointCloud.cpp:62
void GetPointMaskWithinOBB(const core::Tensor &points, const core::Tensor &center, const core::Tensor &rotation, const core::Tensor &extent, core::Tensor &mask)
Definition: PointCloud.cpp:125
void EstimateColorGradientsUsingRadiusSearchCPU(const core::Tensor &points, const core::Tensor &normals, const core::Tensor &colors, core::Tensor &color_gradient, const double &radius)
Definition: PointCloudImpl.h:1240
void GetPointMaskWithinOBBCPU(const core::Tensor &points, const core::Tensor &center, const core::Tensor &rotation, const core::Tensor &extent, core::Tensor &mask)
Definition: PointCloudImpl.h:177
void EstimateColorGradientsUsingHybridSearchCPU(const core::Tensor &points, const core::Tensor &normals, const core::Tensor &colors, core::Tensor &color_gradient, const double &radius, const int64_t &max_nn)
Definition: PointCloudImpl.h:1133
void OrientNormalsToAlignWithDirectionCPU(core::Tensor &normals, const core::Tensor &direction)
Definition: PointCloudImpl.h:252
void EstimateCovariancesUsingKNNSearchCPU(const core::Tensor &points, core::Tensor &covariances, const int64_t &max_nn)
Definition: PointCloudImpl.h:661
Definition: PinholeCameraIntrinsic.cpp:16