31 #include <unordered_map> 32 #include <unordered_set> 115 PointCloud(
const std::unordered_map<std::string, core::Tensor>
116 &map_keys_to_tensors);
261 bool relative =
true);
305 double depth_scale = 1000.0,
306 double depth_max = 3.0,
PointCloud & Transform(const core::Tensor &transformation)
Transforms the points and normals (if exist) of the PointCloud. Extracts R, t from Transformation T (...
Definition: PointCloud.cpp:86
PointCloud & Translate(const core::Tensor &translation, bool relative=true)
Translates the points of the PointCloud.
Definition: PointCloud.cpp:108
void SetPointAttr(const std::string &key, const core::Tensor &value)
Definition: PointCloud.h:164
PointCloud(const core::Device &device=core::Device("CPU:0"))
Construct an empty pointcloud.
Definition: PointCloud.cpp:45
bool IsEmpty() const override
Returns !HasPoints().
Definition: PointCloud.h:225
constexpr nullopt_t nullopt
Definition: Optional.h:146
void SetPoints(const core::Tensor &value)
Set the value of the "points" attribute. Convenience function.
Definition: PointCloud.h:173
TensorMap point_attr_
Definition: PointCloud.h:320
const core::Tensor & GetPointNormals() const
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:155
bool HasPointColors() const
Definition: PointCloud.h:208
core::Device GetDevice() const
Returns the device attribute of this PointCloud.
Definition: PointCloud.h:279
PointCloud & Scale(double scale, const core::Tensor ¢er)
Scales the points of the PointCloud.
Definition: PointCloud.cpp:121
void LogError(const char *format, const Args &... args)
Definition: Console.h:176
const core::Tensor & GetPointAttr(const std::string &key) const
Definition: PointCloud.h:142
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
core::Tensor & GetPoints()
Get the value of the "points" attribute. Convenience function.
Definition: PointCloud.h:131
bool HasPointAttr(const std::string &key) const
Definition: PointCloud.h:194
Device GetDevice() const
Definition: Tensor.cpp:955
core::Tensor & GetPointColors()
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:134
void SetPointNormals(const core::Tensor &value)
Set the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:185
void SetPointColors(const core::Tensor &value)
Set the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:179
core::Device device_
Definition: PointCloud.h:319
The Image class stores image with customizable rols, cols, channels, dtype and device.
Definition: Image.h:45
const core::Tensor & GetPointColors() const
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:150
bool Contains(const std::string &key) const
Definition: TensorMap.h:110
const core::Tensor & GetPoints() const
Get the value of the "points" attribute. Convenience function.
Definition: PointCloud.h:147
A pointcloud contains a set of 3D points.
Definition: PointCloud.h:94
virtual ~PointCloud() override
Definition: PointCloud.h:118
size_t stride
Definition: TriangleMeshBuffers.cpp:183
open3d::geometry::PointCloud ToLegacyPointCloud() const
Convert to a legacy Open3D PointCloud.
Definition: PointCloud.cpp:203
core::Tensor GetMaxBound() const
Returns the max bound for point coordinates.
Definition: PointCloud.cpp:72
static const Dtype Float32
Definition: Dtype.h:42
static PointCloud FromLegacyPointCloud(const open3d::geometry::PointCloud &pcd_legacy, core::Dtype dtype=core::Dtype::Float32, const core::Device &device=core::Device("CPU:0"))
Create a PointCloud from a legacy Open3D PointCloud.
Definition: PointCloud.cpp:181
PointCloud & Clear() override
Clear all data in the pointcloud.
Definition: PointCloud.h:219
The base geometry class.
Definition: Geometry.h:38
bool HasPoints() const
Definition: PointCloud.h:201
int points
Definition: FilePCD.cpp:73
core::Tensor & GetPointNormals()
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:137
core::Tensor GetMinBound() const
Returns the min bound for point coordinates.
Definition: PointCloud.cpp:70
Definition: PinholeCameraIntrinsic.cpp:35
bool HasPointNormals() const
Definition: PointCloud.h:215
PointCloud & Rotate(const core::Tensor &R, const core::Tensor ¢er)
Rotates the points and normals (if exists).
Definition: PointCloud.cpp:130
const TensorMap & GetPointAttr() const
Getter for point_attr_ TensorMap. Used in Pybind.
Definition: PointCloud.h:121
static PointCloud CreateFromDepthImage(const Image &depth, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Dtype::Float32, core::Device("CPU:0")), double depth_scale=1000.0, double depth_max=3.0, int stride=1)
Factory function to create a pointcloud from a depth image and a camera model.
Definition: PointCloud.cpp:148
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create a identity matrix of size n x n.
Definition: Tensor.cpp:194
void AssertShapeCompatible(const DynamicSizeVector &expected_shape) const
Assert that Tensor's shape is compatible with a dynamic shape.
Definition: Tensor.cpp:1256
core::Tensor & GetPointAttr(const std::string &key)
Definition: PointCloud.h:126
core::Tensor GetCenter() const
Returns the center for point coordinates.
Definition: PointCloud.cpp:74
int64_t GetLength() const
Definition: Tensor.h:943
std::string ToString() const
Definition: Device.h:73
Definition: TensorMap.h:49
PointCloud Copy() const
Returns deep copy of the pointcloud on the same device.
Definition: PointCloud.cpp:84