30 #include <unordered_map> 31 #include <unordered_set> 115 PointCloud(
const std::unordered_map<std::string, core::Tensor>
116 &map_keys_to_tensors);
297 bool relative =
true);
332 const int max_nn = 30,
343 const int max_nn = 30,
376 float depth_scale = 1000.0f,
377 float depth_max = 3.0f,
379 bool with_normals =
false);
411 float depth_scale = 1000.0f,
412 float depth_max = 3.0f,
414 bool with_normals =
false);
432 float depth_scale = 1000.0f,
433 float depth_max = 3.0f);
442 float depth_scale = 1000.0f,
443 float depth_max = 3.0f);
PointCloud & Transform(const core::Tensor &transformation)
Transforms the PointPositions and PointNormals (if exist) of the PointCloud.
Definition: PointCloud.cpp:167
PointCloud & Translate(const core::Tensor &translation, bool relative=true)
Translates the PointPositions of the PointCloud.
Definition: PointCloud.cpp:178
void SetPointAttr(const std::string &key, const core::Tensor &value)
Definition: PointCloud.h:169
PointCloud(const core::Device &device=core::Device("CPU:0"))
Definition: PointCloud.cpp:50
bool IsEmpty() const override
Returns !HasPointPositions().
Definition: PointCloud.h:246
constexpr nullopt_t nullopt
Definition: Optional.h:171
PointCloud VoxelDownSample(double voxel_size, const core::HashBackendType &backend=core::HashBackendType::Default) const
Downsamples a point cloud with a specified voxel size.
Definition: PointCloud.cpp:215
void SetPointPositions(const core::Tensor &value)
Set the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:178
TensorMap point_attr_
Definition: PointCloud.h:447
const core::Tensor & GetPointNormals() const
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:160
HashBackendType
Definition: HashMap.h:38
bool HasPointColors() const
Definition: PointCloud.h:219
core::Device GetDevice() const
Returns the device attribute of this PointCloud.
Definition: PointCloud.h:321
PointCloud & Scale(double scale, const core::Tensor ¢er)
Scales the PointPositions of the PointCloud.
Definition: PointCloud.cpp:192
const core::Tensor & GetPointPositions() const
Get the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:150
const core::Tensor & GetPointAttr(const std::string &key) const
Definition: PointCloud.h:145
bool HasPointPositions() const
Definition: PointCloud.h:212
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:55
const Dtype Float32
Definition: Dtype.cpp:61
void RemovePointAttr(const std::string &key)
Definition: PointCloud.h:208
open3d::geometry::PointCloud ToLegacy() const
Convert to a legacy Open3D PointCloud.
Definition: PointCloud.cpp:601
static PointCloud FromLegacy(const open3d::geometry::PointCloud &pcd_legacy, core::Dtype dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
Create a PointCloud from a legacy Open3D PointCloud.
Definition: PointCloud.cpp:578
bool HasPointAttr(const std::string &key) const
Definition: PointCloud.h:199
Device GetDevice() const
Definition: Tensor.cpp:1365
core::Tensor & GetPointColors()
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:137
void SetPointNormals(const core::Tensor &value)
Set the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:190
#define AssertTensorShape(tensor,...)
Definition: TensorCheck.h:77
static PointCloud CreateFromDepthImage(const Image &depth, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Float32, core::Device("CPU:0")), float depth_scale=1000.0f, float depth_max=3.0f, int stride=1, bool with_normals=false)
Factory function to create a point cloud from a depth image and a camera model.
Definition: PointCloud.cpp:478
std::string ToString() const
Text description.
Definition: PointCloud.cpp:75
void SetPointColors(const core::Tensor &value)
Set the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:184
core::Device device_
Definition: PointCloud.h:446
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:48
geometry::Image ProjectToDepthImage(int width, int height, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Float32, core::Device("CPU:0")), float depth_scale=1000.0f, float depth_max=3.0f)
Project a point cloud to a depth image.
Definition: PointCloud.cpp:535
const core::Tensor & GetPointColors() const
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:155
void EstimateColorGradients(const int max_nn=30, const utility::optional< double > radius=utility::nullopt)
Function to compute point color gradients. If radius is provided, then HybridSearch is used...
Definition: PointCloud.cpp:320
bool Contains(const std::string &key) const
Definition: TensorMap.h:134
PointCloud operator+(const PointCloud &other) const
Definition: PointCloud.h:266
A point cloud contains a list of 3D points.
Definition: PointCloud.h:95
virtual ~PointCloud() override
Definition: PointCloud.h:118
size_t stride
Definition: TriangleMeshBuffers.cpp:184
core::Tensor GetMaxBound() const
Returns the max bound for point coordinates.
Definition: PointCloud.cpp:100
Definition: Optional.h:79
PointCloud & Clear() override
Clear all data in the point cloud.
Definition: PointCloud.h:240
The base geometry class.
Definition: Geometry.h:38
static PointCloud CreateFromRGBDImage(const RGBDImage &rgbd_image, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Float32, core::Device("CPU:0")), float depth_scale=1000.0f, float depth_max=3.0f, int stride=1, bool with_normals=false)
Factory function to create a point cloud from an RGB-D image and a camera model.
Definition: PointCloud.cpp:508
core::Tensor & GetPointNormals()
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:140
core::Tensor GetMinBound() const
Returns the min bound for point coordinates.
Definition: PointCloud.cpp:96
Definition: PinholeCameraIntrinsic.cpp:35
bool HasPointNormals() const
Definition: PointCloud.h:226
Mix-in class for geometry types that can be visualized.
Definition: DrawableGeometry.h:38
PointCloud & Rotate(const core::Tensor &R, const core::Tensor ¢er)
Rotates the PointPositions and PointNormals (if exists).
Definition: PointCloud.cpp:202
const TensorMap & GetPointAttr() const
Getter for point_attr_ TensorMap. Used in Pybind.
Definition: PointCloud.h:124
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:40
PointCloud Append(const PointCloud &other) const
Definition: PointCloud.cpp:121
PointCloud Clone() const
Returns copy of the point cloud on the same device.
Definition: PointCloud.cpp:119
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:392
PointCloud To(const core::Device &device, bool copy=false) const
Definition: PointCloud.cpp:108
void EstimateNormals(const int max_nn=30, const utility::optional< double > radius=utility::nullopt)
Function to estimate point normals. If the point cloud normals exist, the estimated normals are orien...
Definition: PointCloud.cpp:244
std::size_t Erase(const std::string key)
Erase elements for the TensorMap by key value, if the key exists. If the key does not exists...
Definition: TensorMap.h:100
core::Tensor & GetPointAttr(const std::string &key)
Definition: PointCloud.h:129
core::Tensor GetCenter() const
Returns the center for point coordinates.
Definition: PointCloud.cpp:104
int64_t GetLength() const
Definition: Tensor.h:1055
std::string ToString() const
Definition: Device.h:75
geometry::RGBDImage ProjectToRGBDImage(int width, int height, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Float32, core::Device("CPU:0")), float depth_scale=1000.0f, float depth_max=3.0f)
Project a point cloud to an RGBD image.
Definition: PointCloud.cpp:552
core::Tensor & GetPointPositions()
Get the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:134
#define LogError(...)
Definition: Logging.h:72
Definition: TensorMap.h:49