Open3D (C++ API)  0.18.0+90810a3
Public Member Functions | Static Public Member Functions | Protected Attributes
open3d::t::geometry::PointCloud Class Reference

A point cloud contains a list of 3D points. More...

#include <PointCloud.h>

Inheritance diagram for open3d::t::geometry::PointCloud:
open3d::t::geometry::Geometry open3d::t::geometry::DrawableGeometry open3d::core::IsDevice

Public Member Functions

 PointCloud (const core::Device &device=core::Device("CPU:0"))
 
 PointCloud (const core::Tensor &points)
 
 PointCloud (const std::unordered_map< std::string, core::Tensor > &map_keys_to_tensors)
 
virtual ~PointCloud () override
 
std::string ToString () const
 Text description. More...
 
const TensorMapGetPointAttr () const
 Getter for point_attr_ TensorMap. Used in Pybind. More...
 
TensorMapGetPointAttr ()
 Getter for point_attr_ TensorMap. More...
 
core::TensorGetPointAttr (const std::string &key)
 
core::TensorGetPointPositions ()
 Get the value of the "positions" attribute. Convenience function. More...
 
core::TensorGetPointColors ()
 Get the value of the "colors" attribute. Convenience function. More...
 
core::TensorGetPointNormals ()
 Get the value of the "normals" attribute. Convenience function. More...
 
const core::TensorGetPointAttr (const std::string &key) const
 
const core::TensorGetPointPositions () const
 Get the value of the "positions" attribute. Convenience function. More...
 
const core::TensorGetPointColors () const
 Get the value of the "colors" attribute. Convenience function. More...
 
const core::TensorGetPointNormals () const
 Get the value of the "normals" attribute. Convenience function. More...
 
void SetPointAttr (const std::string &key, const core::Tensor &value)
 
void SetPointPositions (const core::Tensor &value)
 Set the value of the "positions" attribute. Convenience function. More...
 
void SetPointColors (const core::Tensor &value)
 Set the value of the "colors" attribute. Convenience function. More...
 
void SetPointNormals (const core::Tensor &value)
 Set the value of the "normals" attribute. Convenience function. More...
 
bool HasPointAttr (const std::string &key) const
 
void RemovePointAttr (const std::string &key)
 
bool HasPointPositions () const
 
bool HasPointColors () const
 
bool HasPointNormals () const
 
PointCloud To (const core::Device &device, bool copy=false) const
 
PointCloud Clone () const
 Returns copy of the point cloud on the same device. More...
 
PointCloudClear () override
 Clear all data in the point cloud. More...
 
bool IsEmpty () const override
 Returns !HasPointPositions(). More...
 
core::Tensor GetMinBound () const
 Returns the min bound for point coordinates. More...
 
core::Tensor GetMaxBound () const
 Returns the max bound for point coordinates. More...
 
core::Tensor GetCenter () const
 Returns the center for point coordinates. More...
 
PointCloud Append (const PointCloud &other) const
 
PointCloud operator+ (const PointCloud &other) const
 
PointCloudTransform (const core::Tensor &transformation)
 Transforms the PointPositions and PointNormals (if exist) of the PointCloud. More...
 
PointCloudTranslate (const core::Tensor &translation, bool relative=true)
 Translates the PointPositions of the PointCloud. More...
 
PointCloudScale (double scale, const core::Tensor &center)
 Scales the PointPositions of the PointCloud. More...
 
PointCloudRotate (const core::Tensor &R, const core::Tensor &center)
 Rotates the PointPositions and PointNormals (if exists). More...
 
PointCloudPaintUniformColor (const core::Tensor &color)
 Assigns uniform color to the point cloud. More...
 
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. More...
 
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. More...
 
PointCloud VoxelDownSample (double voxel_size, const std::string &reduction="mean") const
 Downsamples a point cloud with a specified voxel size. More...
 
PointCloud UniformDownSample (size_t every_k_points) const
 Downsamples a point cloud by selecting every kth index point and its attributes. More...
 
PointCloud RandomDownSample (double sampling_ratio) const
 Downsample a pointcloud by selecting random index point and its attributes. More...
 
PointCloud FarthestPointDownSample (size_t num_samples) const
 Downsample a pointcloud into output pointcloud with a set of points has farthest distance. More...
 
std::tuple< PointCloud, core::TensorRemoveRadiusOutliers (size_t nb_points, double search_radius) const
 Remove points that have less than nb_points neighbors in a sphere of a given radius. More...
 
std::tuple< PointCloud, core::TensorRemoveStatisticalOutliers (size_t nb_neighbors, double std_ratio) const
 Remove points that are further away from their nb_neighbor neighbors in average. This function is not recommended to use on GPU. More...
 
std::tuple< PointCloud, core::TensorRemoveDuplicatedPoints () const
 Remove duplicated points and there associated attributes. More...
 
std::tuple< PointCloud, core::TensorRemoveNonFinitePoints (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 corresponding attributes. More...
 
core::Device GetDevice () const override
 Returns the device attribute of this PointCloud. More...
 
std::tuple< TriangleMesh, core::TensorHiddenPointRemoval (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. More...
 
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 Discovering Clusters in Large Spatial Databases with Noise", 1996 This is a wrapper for a CPU implementation and a copy of the point cloud data and resulting labels will be made. More...
 
std::tuple< core::Tensor, core::TensorSegmentPlane (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 copy of the point cloud data and resulting plane model and inlier indiecs will be made. More...
 
TriangleMesh ComputeConvexHull (bool joggle_inputs=false) const
 
std::tuple< PointCloud, core::TensorComputeBoundaryPoints (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 implementation. Reference: https://pointclouds.org/documentation/classpcl_1_1_boundary_estimation.html. More...
 
PointCloudNormalizeNormals ()
 Normalize point normals to length 1. More...
 
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 oriented with respect to the same. It uses KNN search (Not recommended to use on GPU) if only max_nn parameter is provided, Radius search (Not recommended to use on GPU) if only radius is provided and Hybrid Search (Recommended) if radius parameter is also provided. More...
 
void OrientNormalsToAlignWithDirection (const core::Tensor &orientation_reference=core::Tensor::Init< float >({0, 0, 1}, core::Device("CPU:0")))
 Function to orient the normals of a point cloud. More...
 
void OrientNormalsTowardsCameraLocation (const core::Tensor &camera_location=core::Tensor::Zeros({3}, core::Float32, core::Device("CPU:0")))
 Function to orient the normals of a point cloud. More...
 
void OrientNormalsConsistentTangentPlane (size_t k, const double lambda=0.0, const double cos_alpha_tol=1.0)
 Function to consistently orient estimated normals based on consistent tangent planes as described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992. Further details on parameters are described in Piazza, Valentini, Varetti, "Mesh Reconstruction from Point Cloud", 2023. More...
 
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, otherwise KNN-Search is used. Reference: Park, Q.-Y. Zhou, and V. Koltun, Colored Point Cloud Registration Revisited, ICCV, 2017. It uses KNN search (Not recommended to use on GPU) if only max_nn parameter is provided, Radius search (Not recommended to use on GPU) if only radius is provided and Hybrid Search (Recommended) if radius parameter is also provided. More...
 
open3d::geometry::PointCloud ToLegacy () const
 Convert to a legacy Open3D PointCloud. More...
 
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. More...
 
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. More...
 
AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const
 Create an axis-aligned bounding box from attribute "positions". More...
 
OrientedBoundingBox GetOrientedBoundingBox () const
 Create an oriented bounding box from attribute "positions". More...
 
PointCloud Crop (const AxisAlignedBoundingBox &aabb, bool invert=false) const
 Function to crop pointcloud into output pointcloud. More...
 
PointCloud Crop (const OrientedBoundingBox &obb, bool invert=false) const
 Function to crop pointcloud into output pointcloud. More...
 
LineSet ExtrudeRotation (double angle, const core::Tensor &axis, int resolution=16, double translation=0.0, bool capping=true) const
 
LineSet ExtrudeLinear (const core::Tensor &vector, double scale=1.0, bool capping=true) const
 
int PCAPartition (int max_points)
 
- Public Member Functions inherited from open3d::t::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 Returns one of registered geometry types. More...
 
int Dimension () const
 Returns whether the geometry is 2D or 3D. More...
 
std::string GetName () const
 
void SetName (const std::string &name)
 
- Public Member Functions inherited from open3d::core::IsDevice
 IsDevice ()=default
 
virtual ~IsDevice ()=default
 
bool IsCPU () const
 
bool IsCUDA () const
 
bool IsSYCL () const
 
- Public Member Functions inherited from open3d::t::geometry::DrawableGeometry
 DrawableGeometry ()
 
 ~DrawableGeometry ()
 
bool HasMaterial () const
 Check if a material has been applied to this Geometry with SetMaterial. More...
 
visualization::rendering::MaterialGetMaterial ()
 Get material associated with this Geometry. More...
 
const visualization::rendering::MaterialGetMaterial () const
 Get const reference to material associated with this Geometry. More...
 
void SetMaterial (const visualization::rendering::Material &material)
 Set the material properties associate with this Geometry. More...
 

Static Public Member Functions

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. More...
 
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. More...
 
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. More...
 

Protected Attributes

core::Device device_ = core::Device("CPU:0")
 
TensorMap point_attr_
 

Additional Inherited Members

- Public Types inherited from open3d::t::geometry::Geometry
enum class  GeometryType {
  Unspecified = 0 , PointCloud = 1 , VoxelGrid = 2 , Octree = 3 ,
  LineSet = 4 , MeshBase = 5 , TriangleMesh = 6 , HalfEdgeTriangleMesh = 7 ,
  Image = 8 , RGBDImage = 9 , TetraMesh = 10 , OrientedBoundingBox = 11 ,
  AxisAlignedBoundingBox = 12
}
 Specifies possible geometry types. More...
 
- Protected Member Functions inherited from open3d::t::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 Parameterized Constructor. More...
 

Detailed Description

A point cloud contains a list of 3D points.

The point cloud class stores the attribute data in key-value maps, where the key is a string representing the attribute name and the value is a Tensor containing the attribute data. In most cases, the length of an attribute should be equal to the length of the point cloud's "positions".

PointCloud::GetPointAttr(), PointCloud::SetPointAttr(), PointCloud::HasPointAttr() also work for default attribute "position" and common attributes "normals" and "colors", e.g.,

Constructor & Destructor Documentation

◆ PointCloud() [1/3]

open3d::t::geometry::PointCloud::PointCloud ( const core::Device device = core::Device("CPU:0"))

Construct an empty point cloud on the provided device.

Parameters
deviceThe device on which to initialize the point cloud (default: 'CPU:0').

◆ PointCloud() [2/3]

open3d::t::geometry::PointCloud::PointCloud ( const core::Tensor points)

Construct a point cloud from points.

The input tensor will be directly used as the underlying storage of the point cloud (no memory copy).

Parameters
pointsA tensor with element shape {3}.

◆ PointCloud() [3/3]

open3d::t::geometry::PointCloud::PointCloud ( const std::unordered_map< std::string, core::Tensor > &  map_keys_to_tensors)

Construct from points and other attributes of the points.

Parameters
map_keys_to_tensorsA map of string to Tensor containing points and their attributes. point_dict must contain at least the "positions" key.

◆ ~PointCloud()

virtual open3d::t::geometry::PointCloud::~PointCloud ( )
inlineoverridevirtual

Member Function Documentation

◆ Append()

PointCloud open3d::t::geometry::PointCloud::Append ( const PointCloud other) const

Append a point cloud and returns the resulting point cloud.

The point cloud being appended, must have all the attributes present in the point cloud it is being appended to, with same dtype, device and same shape other than the first dimension / length.

◆ Clear()

PointCloud& open3d::t::geometry::PointCloud::Clear ( )
inlineoverridevirtual

Clear all data in the point cloud.

Implements open3d::t::geometry::Geometry.

◆ Clone()

PointCloud open3d::t::geometry::PointCloud::Clone ( ) const

Returns copy of the point cloud on the same device.

◆ ClusterDBSCAN()

core::Tensor open3d::t::geometry::PointCloud::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 Discovering Clusters in Large Spatial Databases with Noise", 1996 This is a wrapper for a CPU implementation and a copy of the point cloud data and resulting labels will be made.

Parameters
epsDensity parameter that is used to find neighbouring points.
min_pointsMinimum number of points to form a cluster.
print_progressIf true the progress is visualized in the console.
Returns
A Tensor list of point labels on the same device as the point cloud, -1 indicates noise according to the algorithm.

◆ ComputeBoundaryPoints()

std::tuple< PointCloud, core::Tensor > open3d::t::geometry::PointCloud::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 implementation. Reference: https://pointclouds.org/documentation/classpcl_1_1_boundary_estimation.html.

Parameters
radiusNeighbor search radius parameter.
max_nnNeighbor search max neighbors parameter [Default = 30].
angle_thresholdAngle threshold to decide if a point is on the boundary [Default = 90.0].
Returns
Tensor of boundary points and its boolean mask tensor.

◆ ComputeConvexHull()

TriangleMesh open3d::t::geometry::PointCloud::ComputeConvexHull ( bool  joggle_inputs = false) const

Compute the convex hull of a point cloud using qhull.

This runs on the CPU.

Parameters
joggle_inputs(default False). Handle precision problems by randomly perturbing the input data. Set to True if perturbing the input iis acceptable but you need convex simplicial output. If False, neighboring facets may be merged in case of precision problems. See QHull docs for more details.
Returns
TriangleMesh representing the convexh hull. This contains an extra vertex property "point_map" that contains the index of the corresponding vertex in the original mesh.

◆ CreateFromDepthImage()

PointCloud open3d::t::geometry::PointCloud::CreateFromDepthImage ( const Image depth,
const core::Tensor intrinsics,
const core::Tensor extrinsics = core::Tensor::Eye(4, core::Float32core::Device("CPU:0")),
float  depth_scale = 1000.0f,
float  depth_max = 3.0f,
int  stride = 1,
bool  with_normals = false 
)
static

Factory function to create a point cloud from a depth image and a camera model.

Given depth value d at (u, v) image coordinate, the corresponding 3d point is:

  • z = d / depth_scale
  • x = (u - cx) * z / fx
  • y = (v - cy) * z / fy
Parameters
depthThe input depth image should be a uint16_t or float image.
intrinsicsIntrinsic parameters of the camera.
extrinsicsExtrinsic parameters of the camera.
depth_scaleThe depth is scaled by 1 / depth_scale.
depth_maxTruncated at depth_max distance.
strideSampling factor to support coarse point cloud extraction. Unless with_normals=true, there is no low pass filtering, so aliasing is possible for stride>1.
with_normalsAlso compute normals for the point cloud. If True, the point cloud will only contain points with valid normals. If normals are requested, the depth map is first filtered to ensure smooth normals.
Returns
Created point cloud with the 'points' property set. Thus is empty if the conversion fails.

◆ CreateFromRGBDImage()

PointCloud open3d::t::geometry::PointCloud::CreateFromRGBDImage ( const RGBDImage rgbd_image,
const core::Tensor intrinsics,
const core::Tensor extrinsics = core::Tensor::Eye(4, core::Float32core::Device("CPU:0")),
float  depth_scale = 1000.0f,
float  depth_max = 3.0f,
int  stride = 1,
bool  with_normals = false 
)
static

Factory function to create a point cloud from an RGB-D image and a camera model.

Given depth value d at (u, v) image coordinate, the corresponding 3d point is:

  • z = d / depth_scale
  • x = (u - cx) * z / fx
  • y = (v - cy) * z / fy
Parameters
rgbd_imageThe input RGBD image should have a uint16_t or float depth image and RGB image with any DType and the same size.
intrinsicsIntrinsic parameters of the camera.
extrinsicsExtrinsic parameters of the camera.
depth_scaleThe depth is scaled by 1 / depth_scale.
depth_maxTruncated at depth_max distance.
strideSampling factor to support coarse point cloud extraction. Unless with_normals=true, there is no low pass filtering, so aliasing is possible for stride>1.
with_normalsAlso compute normals for the point cloud. If True, the point cloud will only contain points with valid normals. If normals are requested, the depth map is first filtered to ensure smooth normals.
Returns
Created point cloud with the 'points' and 'colors' properties set. This is empty if the conversion fails.

◆ Crop() [1/2]

PointCloud open3d::t::geometry::PointCloud::Crop ( const AxisAlignedBoundingBox aabb,
bool  invert = false 
) const

Function to crop pointcloud into output pointcloud.

Parameters
aabbAxisAlignedBoundingBox to crop points.
invertCrop the points outside of the bounding box or inside of the bounding box.

◆ Crop() [2/2]

PointCloud open3d::t::geometry::PointCloud::Crop ( const OrientedBoundingBox obb,
bool  invert = false 
) const

Function to crop pointcloud into output pointcloud.

Parameters
obbOrientedBoundingBox to crop points.
invertCrop the points outside of the bounding box or inside of the bounding box.

◆ EstimateColorGradients()

void open3d::t::geometry::PointCloud::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, otherwise KNN-Search is used. Reference: Park, Q.-Y. Zhou, and V. Koltun, Colored Point Cloud Registration Revisited, ICCV, 2017. It uses KNN search (Not recommended to use on GPU) if only max_nn parameter is provided, Radius search (Not recommended to use on GPU) if only radius is provided and Hybrid Search (Recommended) if radius parameter is also provided.

Parameters
max_nn[optional] Neighbor search max neighbors parameter [Default = 30].
radius[optional] Neighbor search radius parameter to use HybridSearch. [Recommended ~1.4x voxel size].

◆ EstimateNormals()

void open3d::t::geometry::PointCloud::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 oriented with respect to the same. It uses KNN search (Not recommended to use on GPU) if only max_nn parameter is provided, Radius search (Not recommended to use on GPU) if only radius is provided and Hybrid Search (Recommended) if radius parameter is also provided.

Parameters
max_nn[optional] Neighbor search max neighbors parameter [Default = 30].
radius[optional] Neighbor search radius parameter. [Recommended ~1.4x voxel size].

◆ ExtrudeLinear()

LineSet open3d::t::geometry::PointCloud::ExtrudeLinear ( const core::Tensor vector,
double  scale = 1.0,
bool  capping = true 
) const

Sweeps the point cloud along a direction vector.

Parameters
vectorThe direction vector.
scaleScalar factor which essentially scales the direction vector.
cappingIf true adds caps to the mesh.
Returns
A line set with the result of the sweep operation.

◆ ExtrudeRotation()

LineSet open3d::t::geometry::PointCloud::ExtrudeRotation ( double  angle,
const core::Tensor axis,
int  resolution = 16,
double  translation = 0.0,
bool  capping = true 
) const

Sweeps the point cloud rotationally about an axis.

Parameters
angleThe rotation angle in degree.
axisThe rotation axis.
resolutionThe resolution defines the number of intermediate sweeps about the rotation axis.
translationThe translation along the rotation axis.
cappingIf true adds caps to the mesh.
Returns
A line set with the result of the sweep operation.

◆ FarthestPointDownSample()

PointCloud open3d::t::geometry::PointCloud::FarthestPointDownSample ( size_t  num_samples) const

Downsample a pointcloud into output pointcloud with a set of points has farthest distance.

The sampling is performed by selecting the farthest point from previous selected points iteratively.

Parameters
num_samplesNumber of points to be sampled.

◆ FromLegacy()

PointCloud open3d::t::geometry::PointCloud::FromLegacy ( const open3d::geometry::PointCloud pcd_legacy,
core::Dtype  dtype = core::Float32,
const core::Device device = core::Device("CPU:0") 
)
static

Create a PointCloud from a legacy Open3D PointCloud.

◆ GetAxisAlignedBoundingBox()

AxisAlignedBoundingBox open3d::t::geometry::PointCloud::GetAxisAlignedBoundingBox ( ) const

Create an axis-aligned bounding box from attribute "positions".

◆ GetCenter()

core::Tensor open3d::t::geometry::PointCloud::GetCenter ( ) const

Returns the center for point coordinates.

◆ GetDevice()

core::Device open3d::t::geometry::PointCloud::GetDevice ( ) const
inlineoverridevirtual

Returns the device attribute of this PointCloud.

Implements open3d::t::geometry::Geometry.

◆ GetMaxBound()

core::Tensor open3d::t::geometry::PointCloud::GetMaxBound ( ) const

Returns the max bound for point coordinates.

◆ GetMinBound()

core::Tensor open3d::t::geometry::PointCloud::GetMinBound ( ) const

Returns the min bound for point coordinates.

◆ GetOrientedBoundingBox()

OrientedBoundingBox open3d::t::geometry::PointCloud::GetOrientedBoundingBox ( ) const

Create an oriented bounding box from attribute "positions".

◆ GetPointAttr() [1/4]

TensorMap& open3d::t::geometry::PointCloud::GetPointAttr ( )
inline

Getter for point_attr_ TensorMap.

◆ GetPointAttr() [2/4]

const TensorMap& open3d::t::geometry::PointCloud::GetPointAttr ( ) const
inline

Getter for point_attr_ TensorMap. Used in Pybind.

◆ GetPointAttr() [3/4]

core::Tensor& open3d::t::geometry::PointCloud::GetPointAttr ( const std::string &  key)
inline

Get attributes. Throws exception if the attribute does not exist.

Parameters
keyAttribute name.

◆ GetPointAttr() [4/4]

const core::Tensor& open3d::t::geometry::PointCloud::GetPointAttr ( const std::string &  key) const
inline

Get attributes. Throws exception if the attribute does not exist.

Parameters
keyAttribute name.

◆ GetPointColors() [1/2]

core::Tensor& open3d::t::geometry::PointCloud::GetPointColors ( )
inline

Get the value of the "colors" attribute. Convenience function.

◆ GetPointColors() [2/2]

const core::Tensor& open3d::t::geometry::PointCloud::GetPointColors ( ) const
inline

Get the value of the "colors" attribute. Convenience function.

◆ GetPointNormals() [1/2]

core::Tensor& open3d::t::geometry::PointCloud::GetPointNormals ( )
inline

Get the value of the "normals" attribute. Convenience function.

◆ GetPointNormals() [2/2]

const core::Tensor& open3d::t::geometry::PointCloud::GetPointNormals ( ) const
inline

Get the value of the "normals" attribute. Convenience function.

◆ GetPointPositions() [1/2]

core::Tensor& open3d::t::geometry::PointCloud::GetPointPositions ( )
inline

Get the value of the "positions" attribute. Convenience function.

◆ GetPointPositions() [2/2]

const core::Tensor& open3d::t::geometry::PointCloud::GetPointPositions ( ) const
inline

Get the value of the "positions" attribute. Convenience function.

◆ HasPointAttr()

bool open3d::t::geometry::PointCloud::HasPointAttr ( const std::string &  key) const
inline

Returns true if all of the following are true: 1) attribute key exist 2) attribute's length as points' length 3) attribute's length > 0

◆ HasPointColors()

bool open3d::t::geometry::PointCloud::HasPointColors ( ) const
inline

Returns true if all of the following are true: 1) attribute "colors" exist 2) attribute "colors"'s length as points' length 3) attribute "colors"'s length > 0 This is a convenience function.

◆ HasPointNormals()

bool open3d::t::geometry::PointCloud::HasPointNormals ( ) const
inline

Returns true if all of the following are true: 1) attribute "normals" exist 2) attribute "normals"'s length as points' length 3) attribute "normals"'s length > 0 This is a convenience function.

◆ HasPointPositions()

bool open3d::t::geometry::PointCloud::HasPointPositions ( ) const
inline

Check if the "positions" attribute's value has length > 0. This is a convenience function.

◆ HiddenPointRemoval()

std::tuple< TriangleMesh, core::Tensor > open3d::t::geometry::PointCloud::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.

Additional information about the choice of radius for noisy point clouds can be found in Mehra et. al. 'Visibility of Noisy Point Cloud Data', 2010.

This is a wrapper for a CPU implementation and a copy of the point cloud data and resulting visible triangle mesh and indiecs will be made.

Parameters
camera_locationAll points not visible from that location will be removed.
radiusThe radius of the spherical projection.
Returns
Tuple of visible triangle mesh and indices of visible points on the same device as the point cloud.

◆ IsEmpty()

bool open3d::t::geometry::PointCloud::IsEmpty ( ) const
inlineoverridevirtual

Returns !HasPointPositions().

Implements open3d::t::geometry::Geometry.

◆ NormalizeNormals()

PointCloud & open3d::t::geometry::PointCloud::NormalizeNormals ( )

Normalize point normals to length 1.

◆ operator+()

PointCloud open3d::t::geometry::PointCloud::operator+ ( const PointCloud other) const
inline

operator+ for t::PointCloud appends the compatible attributes to the point cloud.

◆ OrientNormalsConsistentTangentPlane()

void open3d::t::geometry::PointCloud::OrientNormalsConsistentTangentPlane ( size_t  k,
const double  lambda = 0.0,
const double  cos_alpha_tol = 1.0 
)

Function to consistently orient estimated normals based on consistent tangent planes as described in Hoppe et al., "Surface Reconstruction from Unorganized Points", 1992. Further details on parameters are described in Piazza, Valentini, Varetti, "Mesh Reconstruction from Point Cloud", 2023.

Parameters
kk nearest neighbour for graph reconstruction for normal propagation.
lambdapenalty constant on the distance of a point from the tangent plane
cos_alpha_toltreshold that defines the amplitude of the cone spanned by the reference normal

◆ OrientNormalsToAlignWithDirection()

void open3d::t::geometry::PointCloud::OrientNormalsToAlignWithDirection ( const core::Tensor orientation_reference = core::Tensor::Init<float>({0, 0, 1},                                              core::Device("CPU:0")))

Function to orient the normals of a point cloud.

Parameters
orientation_referenceNormals are oriented with respect to orientation_reference.

◆ OrientNormalsTowardsCameraLocation()

void open3d::t::geometry::PointCloud::OrientNormalsTowardsCameraLocation ( const core::Tensor camera_location = core::Tensor::Zeros(                    {3}, core::Float32core::Device("CPU:0")))

Function to orient the normals of a point cloud.

Parameters
camera_locationNormals are oriented with towards the camera_location.

◆ PaintUniformColor()

PointCloud & open3d::t::geometry::PointCloud::PaintUniformColor ( const core::Tensor color)

Assigns uniform color to the point cloud.

Parameters
colorRGB color for the point cloud. {3,} shaped Tensor. Floating color values are clipped between 0.0 and 1.0.

◆ PCAPartition()

int open3d::t::geometry::PointCloud::PCAPartition ( int  max_points)

Partition the point cloud by recursively doing PCA. This function creates a new point attribute with the name "partition_ids".

Parameters
max_pointsThe maximum allowed number of points in a partition.
Returns
The number of partitions.

◆ ProjectToDepthImage()

geometry::Image open3d::t::geometry::PointCloud::ProjectToDepthImage ( int  width,
int  height,
const core::Tensor intrinsics,
const core::Tensor extrinsics = core::Tensor::Eye(4, core::Float32core::Device("CPU:0")),
float  depth_scale = 1000.0f,
float  depth_max = 3.0f 
)

Project a point cloud to a depth image.

◆ ProjectToRGBDImage()

geometry::RGBDImage open3d::t::geometry::PointCloud::ProjectToRGBDImage ( int  width,
int  height,
const core::Tensor intrinsics,
const core::Tensor extrinsics = core::Tensor::Eye(4, core::Float32core::Device("CPU:0")),
float  depth_scale = 1000.0f,
float  depth_max = 3.0f 
)

Project a point cloud to an RGBD image.

◆ RandomDownSample()

PointCloud open3d::t::geometry::PointCloud::RandomDownSample ( double  sampling_ratio) const

Downsample a pointcloud by selecting random index point and its attributes.

Parameters
sampling_ratioSampling ratio, the ratio of sample to total number of points in the pointcloud.

◆ RemoveDuplicatedPoints()

std::tuple< PointCloud, core::Tensor > open3d::t::geometry::PointCloud::RemoveDuplicatedPoints ( ) const

Remove duplicated points and there associated attributes.

Returns
Tuple of filtered PointCloud and boolean indexing tensor w.r.t. input point cloud.

◆ RemoveNonFinitePoints()

std::tuple< PointCloud, core::Tensor > open3d::t::geometry::PointCloud::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 corresponding attributes.

Parameters
remove_nanRemove NaN values from the PointCloud.
remove_infiniteRemove infinite values from the PointCloud.
Returns
Tuple of filtered point cloud and boolean mask tensor for selected values w.r.t. input point cloud.

◆ RemovePointAttr()

void open3d::t::geometry::PointCloud::RemovePointAttr ( const std::string &  key)
inline

Removes point attribute by key value. Primary attribute "positions" cannot be removed. Throws warning if attribute key does not exists.

Parameters
keyAttribute name.

◆ RemoveRadiusOutliers()

std::tuple< PointCloud, core::Tensor > open3d::t::geometry::PointCloud::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.

Parameters
nb_pointsNumber of neighbor points required within the radius.
search_radiusRadius of the sphere.
Returns
Tuple of filtered point cloud and boolean mask tensor for selected values w.r.t. input point cloud.

◆ RemoveStatisticalOutliers()

std::tuple< PointCloud, core::Tensor > open3d::t::geometry::PointCloud::RemoveStatisticalOutliers ( size_t  nb_neighbors,
double  std_ratio 
) const

Remove points that are further away from their nb_neighbor neighbors in average. This function is not recommended to use on GPU.

Parameters
nb_neighborsNumber of neighbors around the target point.
std_ratioStandard deviation ratio.
Returns
Tuple of filtered point cloud and boolean mask tensor for selected values w.r.t. input point cloud.

◆ Rotate()

PointCloud & open3d::t::geometry::PointCloud::Rotate ( const core::Tensor R,
const core::Tensor center 
)

Rotates the PointPositions and PointNormals (if exists).

Parameters
RRotation [Tensor of dim {3,3}]. Should be on the same device as the PointCloud
centerCenter [Tensor of dim {3}] about which the PointCloud is to be scaled. Should be on the same device as the PointCloud
Returns
Rotated point cloud

◆ Scale()

PointCloud & open3d::t::geometry::PointCloud::Scale ( double  scale,
const core::Tensor center 
)

Scales the PointPositions of the PointCloud.

Parameters
scaleScale [double] of dimension
centerCenter [Tensor of dim {3}] about which the PointCloud is to be scaled. Should be on the same device as the PointCloud
Returns
Scaled point cloud

◆ SegmentPlane()

std::tuple< core::Tensor, core::Tensor > open3d::t::geometry::PointCloud::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 copy of the point cloud data and resulting plane model and inlier indiecs will be made.

Parameters
distance_thresholdMax distance a point can be from the plane model, and still be considered an inlier.
ransac_nNumber of initial points to be considered inliers in each iteration.
num_iterationsMaximum number of iterations.
probabilityExpected probability of finding the optimal plane.
Returns
Tuple of the plane model ax + by + cz + d = 0 and the indices of the plane inliers on the same device as the point cloud.

◆ SelectByIndex()

PointCloud open3d::t::geometry::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.

Parameters
indicesInt64 indexing tensor of shape {n,} containing index value that is to be selected.
invertSet to True to invert the selection of indices, and also ignore the duplicated indices.
remove_duplicatesSet to True to remove the duplicated indices.

◆ SelectByMask()

PointCloud open3d::t::geometry::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.

Parameters
boolean_maskBoolean indexing tensor of shape {n,} containing true value for the indices that is to be selected.
invertSet to True to invert the selection of indices.

◆ SetPointAttr()

void open3d::t::geometry::PointCloud::SetPointAttr ( const std::string &  key,
const core::Tensor value 
)
inline

Set attributes. If the attribute key already exists, its value will be overwritten, otherwise, the new key will be created.

Parameters
keyAttribute name.
valueA tensor.

◆ SetPointColors()

void open3d::t::geometry::PointCloud::SetPointColors ( const core::Tensor value)
inline

Set the value of the "colors" attribute. Convenience function.

◆ SetPointNormals()

void open3d::t::geometry::PointCloud::SetPointNormals ( const core::Tensor value)
inline

Set the value of the "normals" attribute. Convenience function.

◆ SetPointPositions()

void open3d::t::geometry::PointCloud::SetPointPositions ( const core::Tensor value)
inline

Set the value of the "positions" attribute. Convenience function.

◆ To()

PointCloud open3d::t::geometry::PointCloud::To ( const core::Device device,
bool  copy = false 
) const

Transfer the point cloud to a specified device.

Parameters
deviceThe targeted device to convert to.
copyIf true, a new point cloud is always created; if false, the copy is avoided when the original point cloud is already on the targeted device.

◆ ToLegacy()

open3d::geometry::PointCloud open3d::t::geometry::PointCloud::ToLegacy ( ) const

Convert to a legacy Open3D PointCloud.

◆ ToString()

std::string open3d::t::geometry::PointCloud::ToString ( ) const

Text description.

◆ Transform()

PointCloud & open3d::t::geometry::PointCloud::Transform ( const core::Tensor transformation)

Transforms the PointPositions and PointNormals (if exist) of the PointCloud.

Transformation matrix is a 4x4 matrix. T (4x4) = [[ R(3x3) t(3x1) ], [ O(1x3) s(1x1) ]] (s = 1 for Transformation without scaling)

It applies the following general transform to each positions and normals. |x'| | R(0,0) R(0,1) R(0,2) t(0)| |x| |y'| = | R(1,0) R(1,1) R(1,2) t(1)| @ |y| |z'| | R(2,0) R(2,1) R(2,2) t(2)| |z| |w'| | O(0,0) O(0,1) O(0,2) s | |1|

[x, y, z] = [x', y', z'] / w'

Parameters
transformationTransformation [Tensor of dim {4,4}].
Returns
Transformed point cloud

◆ Translate()

PointCloud & open3d::t::geometry::PointCloud::Translate ( const core::Tensor translation,
bool  relative = true 
)

Translates the PointPositions of the PointCloud.

Parameters
translationtranslation tensor of dimension {3} Should be on the same device as the PointCloud
relativeif true (default): translates relative to Center
Returns
Translated point cloud

◆ UniformDownSample()

PointCloud open3d::t::geometry::PointCloud::UniformDownSample ( size_t  every_k_points) const

Downsamples a point cloud by selecting every kth index point and its attributes.

Parameters
every_k_pointsSample rate, the selected point indices are [0, k, 2k, …].

◆ VoxelDownSample()

PointCloud open3d::t::geometry::PointCloud::VoxelDownSample ( double  voxel_size,
const std::string &  reduction = "mean" 
) const

Downsamples a point cloud with a specified voxel size.

Parameters
voxel_sizeVoxel size. A positive number.
reductionReduction type. Currently only support "mean".

Field Documentation

◆ device_

core::Device open3d::t::geometry::PointCloud::device_ = core::Device("CPU:0")
protected

◆ point_attr_

TensorMap open3d::t::geometry::PointCloud::point_attr_
protected

The documentation for this class was generated from the following files: