Open3D (C++ API)  0.16.1
PointCloud.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// - Open3D: www.open3d.org -
3// ----------------------------------------------------------------------------
4// The MIT License (MIT)
5//
6// Copyright (c) 2018-2021 www.open3d.org
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in
16// all copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24// IN THE SOFTWARE.
25// ----------------------------------------------------------------------------
26
27#pragma once
28
29#include <unordered_map>
30
31#include "open3d/core/Tensor.h"
32
33namespace open3d {
34namespace t {
35namespace geometry {
36namespace kernel {
37namespace pointcloud {
38
39void Unproject(const core::Tensor& depth,
40 utility::optional<std::reference_wrapper<const core::Tensor>>
41 image_colors,
42 core::Tensor& points,
43 utility::optional<std::reference_wrapper<core::Tensor>> colors,
44 const core::Tensor& intrinsics,
45 const core::Tensor& extrinsics,
46 float depth_scale,
47 float depth_max,
48 int64_t stride);
49
50void Project(
51 core::Tensor& depth,
52 utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
53 const core::Tensor& points,
54 utility::optional<std::reference_wrapper<const core::Tensor>> colors,
55 const core::Tensor& intrinsics,
56 const core::Tensor& extrinsics,
57 float depth_scale,
58 float depth_max);
59
60void GetPointMaskWithinAABB(const core::Tensor& points,
61 const core::Tensor& min_bound,
62 const core::Tensor& max_bound,
63 core::Tensor& mask);
64
66 const core::Tensor& center,
67 const core::Tensor& rotation,
68 const core::Tensor& extent,
69 core::Tensor& mask);
70
71void UnprojectCPU(
72 const core::Tensor& depth,
73 utility::optional<std::reference_wrapper<const core::Tensor>>
74 image_colors,
76 utility::optional<std::reference_wrapper<core::Tensor>> colors,
77 const core::Tensor& intrinsics,
78 const core::Tensor& extrinsics,
79 float depth_scale,
80 float depth_max,
81 int64_t stride);
82
83void ProjectCPU(
84 core::Tensor& depth,
85 utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
86 const core::Tensor& points,
87 utility::optional<std::reference_wrapper<const core::Tensor>> colors,
88 const core::Tensor& intrinsics,
89 const core::Tensor& extrinsics,
90 float depth_scale,
91 float depth_max);
92
94 const core::Tensor& min_bound,
95 const core::Tensor& max_bound,
96 core::Tensor& mask);
97
99 const core::Tensor& center,
100 const core::Tensor& rotation,
101 const core::Tensor& extent,
102 core::Tensor& mask);
103
104void NormalizeNormalsCPU(core::Tensor& normals);
105
107 const core::Tensor& direction);
108
110 core::Tensor& normals,
111 const core::Tensor& camera);
112
114 const core::Tensor& normals,
115 const core::Tensor& indices,
116 const core::Tensor& counts,
117 core::Tensor& mask,
118 double angle_threshold);
119
120#ifdef BUILD_CUDA_MODULE
121void UnprojectCUDA(
122 const core::Tensor& depth,
123 utility::optional<std::reference_wrapper<const core::Tensor>>
124 image_colors,
126 utility::optional<std::reference_wrapper<core::Tensor>> colors,
127 const core::Tensor& intrinsics,
128 const core::Tensor& extrinsics,
129 float depth_scale,
130 float depth_max,
131 int64_t stride);
132
133void ProjectCUDA(
134 core::Tensor& depth,
135 utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
136 const core::Tensor& points,
137 utility::optional<std::reference_wrapper<const core::Tensor>> colors,
138 const core::Tensor& intrinsics,
139 const core::Tensor& extrinsics,
140 float depth_scale,
141 float depth_max);
142
143void GetPointMaskWithinAABBCUDA(const core::Tensor& points,
144 const core::Tensor& min_bound,
145 const core::Tensor& max_bound,
146 core::Tensor& mask);
147
148void GetPointMaskWithinOBBCUDA(const core::Tensor& points,
149 const core::Tensor& center,
150 const core::Tensor& rotation,
151 const core::Tensor& extent,
152 core::Tensor& mask);
153
154void NormalizeNormalsCUDA(core::Tensor& normals);
155
156void OrientNormalsToAlignWithDirectionCUDA(core::Tensor& normals,
157 const core::Tensor& direction);
158
159void OrientNormalsTowardsCameraLocationCUDA(const core::Tensor& points,
160 core::Tensor& normals,
161 const core::Tensor& camera);
162
163void ComputeBoundaryPointsCUDA(const core::Tensor& points,
164 const core::Tensor& normals,
165 const core::Tensor& indices,
166 const core::Tensor& counts,
167 core::Tensor& mask,
168 double angle_threshold);
169#endif
170
172 core::Tensor& covariances,
173 const double& radius,
174 const int64_t& max_nn);
175
177 core::Tensor& covariances,
178 const int64_t& max_nn);
179
181 core::Tensor& covariances,
182 const double& radius);
183
184void EstimateNormalsFromCovariancesCPU(const core::Tensor& covariances,
185 core::Tensor& normals,
186 const bool has_normals);
187
189 const core::Tensor& normals,
190 const core::Tensor& colors,
191 core::Tensor& color_gradient,
192 const double& radius,
193 const int64_t& max_nn);
194
196 const core::Tensor& normals,
197 const core::Tensor& colors,
198 core::Tensor& color_gradient,
199 const int64_t& max_nn);
200
202 const core::Tensor& normals,
203 const core::Tensor& colors,
204 core::Tensor& color_gradient,
205 const double& radius);
206
207#ifdef BUILD_CUDA_MODULE
208void EstimateCovariancesUsingHybridSearchCUDA(const core::Tensor& points,
209 core::Tensor& covariances,
210 const double& radius,
211 const int64_t& max_nn);
212
213void EstimateCovariancesUsingKNNSearchCUDA(const core::Tensor& points,
214 core::Tensor& covariances,
215 const int64_t& max_nn);
216
217void EstimateCovariancesUsingRadiusSearchCUDA(const core::Tensor& points,
218 core::Tensor& covariances,
219 const double& radius);
220
221void EstimateNormalsFromCovariancesCUDA(const core::Tensor& covariances,
222 core::Tensor& normals,
223 const bool has_normals);
224
225void EstimateColorGradientsUsingHybridSearchCUDA(const core::Tensor& points,
226 const core::Tensor& normals,
227 const core::Tensor& colors,
228 core::Tensor& color_gradient,
229 const double& radius,
230 const int64_t& max_nn);
231
232void EstimateColorGradientsUsingKNNSearchCUDA(const core::Tensor& points,
233 const core::Tensor& normals,
234 const core::Tensor& colors,
235 core::Tensor& color_gradient,
236 const int64_t& max_nn);
237
238void EstimateColorGradientsUsingRadiusSearchCUDA(const core::Tensor& points,
239 const core::Tensor& normals,
240 const core::Tensor& colors,
241 core::Tensor& color_gradient,
242 const double& radius);
243#endif
244
245} // namespace pointcloud
246} // namespace kernel
247} // namespace geometry
248} // namespace t
249} // namespace open3d
size_t stride
Definition: TriangleMeshBuffers.cpp:184
Definition: Tensor.h:51
Definition: Optional.h:278
bool has_normals
Definition: FilePCD.cpp:80
int points
Definition: FilePCD.cpp:73
void EstimateCovariancesUsingHybridSearchCPU(const core::Tensor &points, core::Tensor &covariances, const double &radius, const int64_t &max_nn)
Definition: PointCloudImpl.h:537
void GetPointMaskWithinAABB(const core::Tensor &points, const core::Tensor &min_bound, const core::Tensor &max_bound, core::Tensor &mask)
Definition: PointCloud.cpp:119
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:81
void EstimateCovariancesUsingRadiusSearchCPU(const core::Tensor &points, core::Tensor &covariances, const double &radius)
Definition: PointCloudImpl.h:587
void EstimateNormalsFromCovariancesCPU(const core::Tensor &covariances, core::Tensor &normals, const bool has_normals)
Definition: PointCloudImpl.h:954
void OrientNormalsTowardsCameraLocationCPU(const core::Tensor &points, core::Tensor &normals, const core::Tensor &camera)
Definition: PointCloudImpl.h:260
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:63
void GetPointMaskWithinAABBCPU(const core::Tensor &points, const core::Tensor &min_bound, const core::Tensor &max_bound, core::Tensor &mask)
Definition: PointCloudImpl.h:161
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:395
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:1160
void NormalizeNormalsCPU(core::Tensor &normals)
Definition: PointCloudImpl.h:195
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:37
void GetPointMaskWithinOBB(const core::Tensor &points, const core::Tensor &center, const core::Tensor &rotation, const core::Tensor &extent, core::Tensor &mask)
void EstimateColorGradientsUsingRadiusSearchCPU(const core::Tensor &points, const core::Tensor &normals, const core::Tensor &colors, core::Tensor &color_gradient, const double &radius)
Definition: PointCloudImpl.h:1215
void GetPointMaskWithinOBBCPU(const core::Tensor &points, const core::Tensor &center, const core::Tensor &rotation, const core::Tensor &extent, core::Tensor &mask)
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:1108
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:42
void OrientNormalsToAlignWithDirectionCPU(core::Tensor &normals, const core::Tensor &direction)
Definition: PointCloudImpl.h:226
void EstimateCovariancesUsingKNNSearchCPU(const core::Tensor &points, core::Tensor &covariances, const int64_t &max_nn)
Definition: PointCloudImpl.h:636
Definition: PinholeCameraIntrinsic.cpp:35