30 #include <unordered_map> 31 #include <unordered_set> 116 PointCloud(
const std::unordered_map<std::string, core::Tensor>
117 &map_keys_to_tensors);
301 bool relative =
true);
356 float depth_scale = 1000.0f,
357 float depth_max = 3.0f,
359 bool with_normals =
false);
391 float depth_scale = 1000.0f,
392 float depth_max = 3.0f,
394 bool with_normals =
false);
412 float depth_scale = 1000.0f,
413 float depth_max = 3.0f);
422 float depth_scale = 1000.0f,
423 float depth_max = 3.0f);
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:156
PointCloud & Translate(const core::Tensor &translation, bool relative=true)
Translates the points of the PointCloud.
Definition: PointCloud.cpp:183
void SetPointAttr(const std::string &key, const core::Tensor &value)
Definition: PointCloud.h:168
PointCloud(const core::Device &device=core::Device("CPU:0"))
Construct an empty pointcloud.
Definition: PointCloud.cpp:46
void AssertShapeCompatible(const DynamicSizeVector &expected_shape, const std::string &error_msg="") const
Assert that Tensor's shape is compatible with a dynamic shape.
Definition: Tensor.cpp:1513
bool IsEmpty() const override
Returns !HasPoints().
Definition: PointCloud.h:258
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:177
TensorMap point_attr_
Definition: PointCloud.h:427
const core::Tensor & GetPointNormals() const
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:159
HashmapBackend
Definition: Hashmap.h:38
bool HasPointColors() const
Definition: PointCloud.h:218
core::Device GetDevice() const
Returns the device attribute of this PointCloud.
Definition: PointCloud.h:325
PointCloud & Scale(double scale, const core::Tensor ¢er)
Scales the points of the PointCloud.
Definition: PointCloud.cpp:196
static PointCloud CreateFromRGBDImage(const RGBDImage &rgbd_image, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Dtype::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 pointcloud from an RGB-D image and a camera model.
Definition: PointCloud.cpp:365
const core::Tensor & GetPointAttr(const std::string &key) const
Definition: PointCloud.h:146
PointCloud CUDA(int device_id=0) const
Definition: PointCloud.h:247
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
void RemovePointAttr(const std::string &key)
Definition: PointCloud.h:207
core::Tensor & GetPoints()
Get the value of the "points" attribute. Convenience function.
Definition: PointCloud.h:135
bool HasPointAttr(const std::string &key) const
Definition: PointCloud.h:198
Device GetDevice() const
Definition: Tensor.cpp:1098
core::Tensor & GetPointColors()
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:138
#define LogError(...)
Definition: Console.h:79
void SetPointNormals(const core::Tensor &value)
Set the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:189
std::string ToString() const
Text description.
Definition: PointCloud.cpp:71
void SetPointColors(const core::Tensor &value)
Set the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:183
core::Device device_
Definition: PointCloud.h:426
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:48
geometry::RGBDImage ProjectToRGBDImage(int width, int height, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Dtype::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:410
const core::Tensor & GetPointColors() const
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:154
bool Contains(const std::string &key) const
Definition: TensorMap.h:125
const core::Tensor & GetPoints() const
Get the value of the "points" attribute. Convenience function.
Definition: PointCloud.h:151
PointCloud VoxelDownSample(double voxel_size, const core::HashmapBackend &backend=core::HashmapBackend::Default) const
Downsamples a point cloud with a specified voxel size.
Definition: PointCloud.cpp:223
PointCloud operator+(const PointCloud &other) const
Definition: PointCloud.h:278
A pointcloud contains a set of 3D points.
Definition: PointCloud.h:95
virtual ~PointCloud() override
Definition: PointCloud.h:119
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")), float depth_scale=1000.0f, float depth_max=3.0f, int stride=1, bool with_normals=false)
Factory function to create a pointcloud from a depth image and a camera model.
Definition: PointCloud.cpp:337
size_t stride
Definition: TriangleMeshBuffers.cpp:183
open3d::geometry::PointCloud ToLegacyPointCloud() const
Convert to a legacy Open3D PointCloud.
Definition: PointCloud.cpp:455
core::Tensor GetMaxBound() const
Returns the max bound for point coordinates.
Definition: PointCloud.cpp:92
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:433
PointCloud & Clear() override
Clear all data in the pointcloud.
Definition: PointCloud.h:252
The base geometry class.
Definition: Geometry.h:38
bool HasPoints() const
Definition: PointCloud.h:211
int points
Definition: FilePCD.cpp:73
PointCloud CPU() const
Definition: PointCloud.h:241
core::Tensor & GetPointNormals()
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:141
core::Tensor GetMinBound() const
Returns the min bound for point coordinates.
Definition: PointCloud.cpp:90
Definition: PinholeCameraIntrinsic.cpp:35
bool HasPointNormals() const
Definition: PointCloud.h:225
PointCloud & Rotate(const core::Tensor &R, const core::Tensor ¢er)
Rotates the points and normals (if exists).
Definition: PointCloud.cpp:205
const TensorMap & GetPointAttr() const
Getter for point_attr_ TensorMap. Used in Pybind.
Definition: PointCloud.h:125
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:40
int height
Definition: FilePCD.cpp:72
PointCloud Append(const PointCloud &other) const
Definition: PointCloud.cpp:109
geometry::Image ProjectToDepthImage(int width, int height, const core::Tensor &intrinsics, const core::Tensor &extrinsics=core::Tensor::Eye(4, core::Dtype::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:396
PointCloud Clone() const
Returns copy of the point cloud on the same device.
Definition: PointCloud.cpp:107
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:252
PointCloud To(const core::Device &device, bool copy=false) const
Definition: PointCloud.cpp:96
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:130
core::Tensor GetCenter() const
Returns the center for point coordinates.
Definition: PointCloud.cpp:94
int64_t GetLength() const
Definition: Tensor.h:986
std::string ToString() const
Definition: Device.h:73
Definition: TensorMap.h:49
int width
Definition: FilePCD.cpp:71