30 #include <unordered_map> 31 #include <unordered_set> 119 PointCloud(
const std::unordered_map<std::string, core::Tensor>
120 &map_keys_to_tensors);
304 bool relative =
true);
328 bool invert =
false)
const;
340 bool remove_duplicates =
false)
const;
380 size_t nb_points,
double search_radius)
const;
396 bool remove_nan =
true,
bool remove_infinite =
true)
const;
423 const core::Tensor &camera_location,
double radius)
const;
439 bool print_progress =
false)
const;
454 const double distance_threshold = 0.01,
455 const int ransac_n = 3,
456 const int num_iterations = 100,
457 const double probability = 0.99999999)
const;
488 double angle_threshold = 90.0)
const;
553 float depth_scale = 1000.0f,
554 float depth_max = 3.0f,
556 bool with_normals =
false);
588 float depth_scale = 1000.0f,
589 float depth_max = 3.0f,
591 bool with_normals =
false);
609 float depth_scale = 1000.0f,
610 float depth_max = 3.0f);
619 float depth_scale = 1000.0f,
620 float depth_max = 3.0f);
631 bool invert =
false)
const;
644 double translation = 0.0,
645 bool capping =
true)
const;
654 bool capping =
true)
const;
PointCloud FarthestPointDownSample(size_t num_samples) const
Downsample a pointcloud into output pointcloud with a set of points has farthest distance.
Definition: PointCloud.cpp:368
PointCloud & Transform(const core::Tensor &transformation)
Transforms the PointPositions and PointNormals (if exist) of the PointCloud.
Definition: PointCloud.cpp:187
PointCloud & Translate(const core::Tensor &translation, bool relative=true)
Translates the PointPositions of the PointCloud.
Definition: PointCloud.cpp:198
void SetPointAttr(const std::string &key, const core::Tensor &value)
Definition: PointCloud.h:176
PointCloud(const core::Device &device=core::Device("CPU:0"))
Definition: PointCloud.cpp:65
bool IsEmpty() const override
Returns !HasPointPositions().
Definition: PointCloud.h:253
constexpr nullopt_t nullopt
Definition: Optional.h:171
LineSet ExtrudeLinear(const core::Tensor &vector, double scale=1.0, bool capping=true) const
Definition: PointCloud.cpp:1121
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:296
void SetPointPositions(const core::Tensor &value)
Set the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:185
PointCloud SelectByMask(const core::Tensor &boolean_mask, bool invert=false) const
Select points from input pointcloud, based on boolean mask indices into output point cloud...
Definition: PointCloud.cpp:235
PointCloud UniformDownSample(size_t every_k_points) const
Downsamples a point cloud by selecting every kth index point and its attributes.
Definition: PointCloud.cpp:325
TensorMap point_attr_
Definition: PointCloud.h:658
const core::Tensor & GetPointNormals() const
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:167
HashBackendType
Definition: HashMap.h:39
bool HasPointColors() const
Definition: PointCloud.h:226
PointCloud Crop(const AxisAlignedBoundingBox &aabb, bool invert=false) const
Function to crop pointcloud into output pointcloud.
Definition: PointCloud.cpp:1093
PointCloud PaintUniformColor(const core::Tensor &color) const
Assigns uniform color to the point cloud.
Definition: PointCloud.cpp:450
PointCloud & Scale(double scale, const core::Tensor ¢er)
Scales the PointPositions of the PointCloud.
Definition: PointCloud.cpp:212
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:111
PointCloud RandomDownSample(double sampling_ratio) const
Downsample a pointcloud by selecting random index point and its attributes.
Definition: PointCloud.cpp:343
const core::Tensor & GetPointPositions() const
Get the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:157
const core::Tensor & GetPointAttr(const std::string &key) const
Definition: PointCloud.h:152
bool HasPointPositions() const
Definition: PointCloud.h:219
TensorMap & GetPointAttr()
Getter for point_attr_ TensorMap.
Definition: PointCloud.h:131
LineSet ExtrudeRotation(double angle, const core::Tensor &axis, int resolution=16, double translation=0.0, bool capping=true) const
Definition: PointCloud.cpp:1111
std::tuple< PointCloud, core::Tensor > RemoveNonFinitePoints(bool remove_nan=true, bool remove_infinite=true) const
Remove all points from the point cloud that have a nan entry, or infinite value. It also removes the ...
Definition: PointCloud.cpp:404
PointCloud SelectByIndex(const core::Tensor &indices, bool invert=false, bool remove_duplicates=false) const
Select points from input pointcloud, based on indices list into output point cloud.
Definition: PointCloud.cpp:261
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:215
open3d::geometry::PointCloud ToLegacy() const
Convert to a legacy Open3D PointCloud.
Definition: PointCloud.cpp:910
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:887
core::Device GetDevice() const override
Returns the device attribute of this PointCloud.
Definition: PointCloud.h:405
TriangleMesh ComputeConvexHull(bool joggle_inputs=false) const
Definition: PointCloud.cpp:1023
bool HasPointAttr(const std::string &key) const
Definition: PointCloud.h:206
std::tuple< TriangleMesh, core::Tensor > HiddenPointRemoval(const core::Tensor &camera_location, double radius) const
This is an implementation of the Hidden Point Removal operator described in Katz et. al. 'Direct Visibility of Point Sets', 2007.
Definition: PointCloud.cpp:963
core::Tensor & GetPointColors()
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:144
Device GetDevice() const override
Definition: Tensor.cpp:1384
void SetPointNormals(const core::Tensor &value)
Set the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:197
#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:781
std::tuple< PointCloud, core::Tensor > RemoveRadiusOutliers(size_t nb_points, double search_radius) const
Remove points that have less than nb_points neighbors in a sphere of a given radius.
Definition: PointCloud.cpp:376
std::string ToString() const
Text description.
Definition: PointCloud.cpp:90
void SetPointColors(const core::Tensor &value)
Set the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:191
AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const
Create an axis-aligned bounding box from attribute "positions".
Definition: PointCloud.cpp:1107
core::Device device_
Definition: PointCloud.h:657
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:48
math::float4 color
Definition: LineSetBuffers.cpp:64
void EstimateColorGradients(const utility::optional< 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:606
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:838
const core::Tensor & GetPointColors() const
Get the value of the "colors" attribute. Convenience function.
Definition: PointCloud.h:162
bool Contains(const std::string &key) const
Definition: TensorMap.h:206
PointCloud operator+(const PointCloud &other) const
Definition: PointCloud.h:273
A point cloud contains a list of 3D points.
Definition: PointCloud.h:99
virtual ~PointCloud() override
Definition: PointCloud.h:122
size_t stride
Definition: TriangleMeshBuffers.cpp:184
core::Tensor GetMaxBound() const
Returns the max bound for point coordinates.
Definition: PointCloud.cpp:120
Definition: Optional.h:79
PointCloud & Clear() override
Clear all data in the point cloud.
Definition: PointCloud.h:247
The base geometry class.
Definition: Geometry.h:40
A LineSet contains points and lines joining them and optionally attributes on the points and lines...
Definition: LineSet.h:103
std::tuple< PointCloud, core::Tensor > RemoveDuplicatedPoints() const
Remove duplicated points and there associated attributes.
Definition: PointCloud.cpp:428
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:811
std::tuple< PointCloud, core::Tensor > ComputeBoundaryPoints(double radius, int max_nn=30, double angle_threshold=90.0) const
Compute the boundary points of a point cloud. The implementation is inspired by the PCL implementatio...
Definition: PointCloud.cpp:467
core::Tensor & GetPointNormals()
Get the value of the "normals" attribute. Convenience function.
Definition: PointCloud.h:147
core::Tensor GetMinBound() const
Returns the min bound for point coordinates.
Definition: PointCloud.cpp:116
Definition: PinholeCameraIntrinsic.cpp:35
void EstimateNormals(const utility::optional< 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:512
bool HasPointNormals() const
Definition: PointCloud.h:233
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:222
const TensorMap & GetPointAttr() const
Getter for point_attr_ TensorMap. Used in Pybind.
Definition: PointCloud.h:128
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:40
std::tuple< core::Tensor, core::Tensor > SegmentPlane(const double distance_threshold=0.01, const int ransac_n=3, const int num_iterations=100, const double probability=0.99999999) const
Segment PointCloud plane using the RANSAC algorithm. This is a wrapper for a CPU implementation and a...
Definition: PointCloud.cpp:1001
PointCloud Append(const PointCloud &other) const
Definition: PointCloud.cpp:141
PointCloud Clone() const
Returns copy of the point cloud on the same device.
Definition: PointCloud.cpp:139
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound...
Definition: BoundingVolume.h:63
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:404
PointCloud To(const core::Device &device, bool copy=false) const
Definition: PointCloud.cpp:128
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:111
core::Tensor & GetPointAttr(const std::string &key)
Definition: PointCloud.h:136
core::Tensor GetCenter() const
Returns the center for point coordinates.
Definition: PointCloud.cpp:124
bool copy
Definition: VtkUtils.cpp:89
core::Tensor ClusterDBSCAN(double eps, size_t min_points, bool print_progress=false) const
Cluster PointCloud using the DBSCAN algorithm Ester et al., "A Density-Based Algorithm for Discoverin...
Definition: PointCloud.cpp:989
int64_t GetLength() const
Definition: Tensor.h:1130
std::string ToString() const
Returns string representation of device, e.g. "CPU:0", "CUDA:0".
Definition: Device.cpp:107
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:855
core::Tensor & GetPointPositions()
Get the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:141
#define LogError(...)
Definition: Logging.h:67
Definition: TensorMap.h:50