Loading [MathJax]/jax/output/HTML-CSS/config.js
Open3D (C++ API)  0.14.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
33 namespace open3d {
34 namespace t {
35 namespace geometry {
36 namespace kernel {
37 namespace pointcloud {
38 
39 void Unproject(const core::Tensor& depth,
40  utility::optional<std::reference_wrapper<const core::Tensor>>
41  image_colors,
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 
50 void 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 
60 void UnprojectCPU(
61  const core::Tensor& depth,
62  utility::optional<std::reference_wrapper<const core::Tensor>>
63  image_colors,
65  utility::optional<std::reference_wrapper<core::Tensor>> colors,
66  const core::Tensor& intrinsics,
67  const core::Tensor& extrinsics,
68  float depth_scale,
69  float depth_max,
70  int64_t stride);
71 
72 void ProjectCPU(
73  core::Tensor& depth,
74  utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
75  const core::Tensor& points,
76  utility::optional<std::reference_wrapper<const core::Tensor>> colors,
77  const core::Tensor& intrinsics,
78  const core::Tensor& extrinsics,
79  float depth_scale,
80  float depth_max);
81 
82 #ifdef BUILD_CUDA_MODULE
83 void UnprojectCUDA(
84  const core::Tensor& depth,
85  utility::optional<std::reference_wrapper<const core::Tensor>>
86  image_colors,
88  utility::optional<std::reference_wrapper<core::Tensor>> colors,
89  const core::Tensor& intrinsics,
90  const core::Tensor& extrinsics,
91  float depth_scale,
92  float depth_max,
93  int64_t stride);
94 
95 void ProjectCUDA(
96  core::Tensor& depth,
97  utility::optional<std::reference_wrapper<core::Tensor>> image_colors,
98  const core::Tensor& points,
99  utility::optional<std::reference_wrapper<const core::Tensor>> colors,
100  const core::Tensor& intrinsics,
101  const core::Tensor& extrinsics,
102  float depth_scale,
103  float depth_max);
104 #endif
105 
107  core::Tensor& covariances,
108  const double& radius,
109  const int64_t& max_nn);
110 
112  core::Tensor& covariances,
113  const int64_t& max_nn);
114 
115 void EstimateNormalsFromCovariancesCPU(const core::Tensor& covariances,
116  core::Tensor& normals,
117  const bool has_normals);
118 
120  const core::Tensor& normals,
121  const core::Tensor& colors,
122  core::Tensor& color_gradient,
123  const double& radius,
124  const int64_t& max_nn);
125 
127  const core::Tensor& normals,
128  const core::Tensor& colors,
129  core::Tensor& color_gradient,
130  const int64_t& max_nn);
131 
132 #ifdef BUILD_CUDA_MODULE
133 void EstimateCovariancesUsingHybridSearchCUDA(const core::Tensor& points,
134  core::Tensor& covariances,
135  const double& radius,
136  const int64_t& max_nn);
137 
138 void EstimateCovariancesUsingKNNSearchCUDA(const core::Tensor& points,
139  core::Tensor& covariances,
140  const int64_t& max_nn);
141 
142 void EstimateNormalsFromCovariancesCUDA(const core::Tensor& covariances,
143  core::Tensor& normals,
144  const bool has_normals);
145 
146 void EstimateColorGradientsUsingHybridSearchCUDA(const core::Tensor& points,
147  const core::Tensor& normals,
148  const core::Tensor& colors,
149  core::Tensor& color_gradient,
150  const double& radius,
151  const int64_t& max_nn);
152 
153 void EstimateColorGradientsUsingKNNSearchCUDA(const core::Tensor& points,
154  const core::Tensor& normals,
155  const core::Tensor& colors,
156  core::Tensor& color_gradient,
157  const int64_t& max_nn);
158 #endif
159 
160 } // namespace pointcloud
161 } // namespace kernel
162 } // namespace geometry
163 } // namespace t
164 } // namespace open3d
bool has_normals
Definition: FilePCD.cpp:80
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:759
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:238
size_t stride
Definition: TriangleMeshBuffers.cpp:184
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 EstimateCovariancesUsingKNNSearchCPU(const core::Tensor &points, core::Tensor &covariances, const int64_t &max_nn)
Definition: PointCloudImpl.h:288
Definition: PinholeCameraIntrinsic.cpp:35
void EstimateNormalsFromCovariancesCPU(const core::Tensor &covariances, core::Tensor &normals, const bool has_normals)
Definition: PointCloudImpl.h:605
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:812
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 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:83
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:35