![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A point cloud contains a list of 3D points. More...
#include <PointCloud.h>


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 TensorMap & | GetPointAttr () const |
| Getter for point_attr_ TensorMap. Used in Pybind. More... | |
| TensorMap & | GetPointAttr () |
| Getter for point_attr_ TensorMap. More... | |
| core::Tensor & | GetPointAttr (const std::string &key) |
| core::Tensor & | GetPointPositions () |
| Get the value of the "positions" attribute. Convenience function. More... | |
| core::Tensor & | GetPointColors () |
| Get the value of the "colors" attribute. Convenience function. More... | |
| core::Tensor & | GetPointNormals () |
| Get the value of the "normals" attribute. Convenience function. More... | |
| const core::Tensor & | GetPointAttr (const std::string &key) const |
| const core::Tensor & | GetPointPositions () const |
| Get the value of the "positions" attribute. Convenience function. More... | |
| core::Tensor & | GetPoints () |
| const core::Tensor & | GetPoints () const |
| Backward-compatible const getter for point positions. More... | |
| void | SetPoints (const core::Tensor &value) |
| bool | HasPoints () const |
| const core::Tensor & | GetPointColors () const |
| Get the value of the "colors" attribute. Convenience function. More... | |
| const core::Tensor & | GetPointNormals () 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 | CPU () const |
| Backward-compatible convenience method to obtain a CPU-resident copy. More... | |
| PointCloud | Clone () const |
| Returns copy of the point cloud on the same device. More... | |
| PointCloud & | Clear () 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 |
| PointCloud & | Transform (const core::Tensor &transformation) |
| Transforms the PointPositions and PointNormals (if exist) of the PointCloud. More... | |
| PointCloud & | Translate (const core::Tensor &translation, bool relative=true) |
| Translates the PointPositions of the PointCloud. More... | |
| PointCloud & | Scale (double scale, const core::Tensor ¢er) |
| Scales the PointPositions of the PointCloud. More... | |
| PointCloud & | Rotate (const core::Tensor &R, const core::Tensor ¢er) |
| Rotates the PointPositions and PointNormals (if exists). More... | |
| PointCloud & | PaintUniformColor (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 (const size_t num_samples, const size_t start_index=0) const |
| Downsample a pointcloud into output pointcloud with a set of points has farthest distance. More... | |
| 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. More... | |
| std::tuple< PointCloud, core::Tensor > | 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. More... | |
| std::tuple< PointCloud, core::Tensor > | RemoveDuplicatedPoints () const |
| Remove duplicated points and there associated attributes. More... | |
| 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 corresponding attributes. More... | |
| core::Device | GetDevice () const override |
| Returns the device attribute of this PointCloud. More... | |
| 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. 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::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 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::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 implementation. Reference: https://pointclouds.org/documentation/classpcl_1_1_boundary_estimation.html. More... | |
| PointCloud & | NormalizeNormals () |
| 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... | |
| cloudViewer::geometry::PointCloud | ToLegacy () const |
| Convert to a legacy CloudViewer 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) |
| core::Tensor | ComputeMetrics (const PointCloud &pcd2, std::vector< Metric > metrics={Metric::ChamferDistance}, MetricParameters params=MetricParameters()) const |
| bool | IsGaussianSplat () const |
| int | GaussianSplatGetSHOrder () const |
| Returns the order of spherical harmonics used for Gaussian Splatting. Returns 0 if f_rest is not present. More... | |
Public Member Functions inherited from cloudViewer::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 cloudViewer::core::IsDevice | |
| IsDevice ()=default | |
| virtual | ~IsDevice ()=default |
| bool | IsCPU () const |
| bool | IsCUDA () const |
| bool | IsSYCL () const |
Public Member Functions inherited from cloudViewer::t::geometry::DrawableGeometry | |
| DrawableGeometry () | |
| ~DrawableGeometry () | |
| bool | HasMaterial () const |
| Check if a material has been applied to this Geometry with SetMaterial. More... | |
| visualization::rendering::Material & | GetMaterial () |
| Get material associated with this Geometry. More... | |
| const visualization::rendering::Material & | GetMaterial () 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 cloudViewer::geometry::PointCloud &pcd_legacy, core::Dtype dtype=core::Float32, const core::Device &device=core::Device("CPU:0")) |
| Create a PointCloud from a legacy CloudViewer PointCloud. More... | |
Protected Attributes | |
| core::Device | device_ = core::Device("CPU:0") |
| TensorMap | point_attr_ |
Additional Inherited Members | |
Public Types inherited from cloudViewer::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 cloudViewer::t::geometry::Geometry | |
| Geometry (GeometryType type, int dimension) | |
| Parameterized Constructor. More... | |
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.,
Definition at line 82 of file PointCloud.h.
| cloudViewer::t::geometry::PointCloud::PointCloud | ( | const core::Device & | device = core::Device("CPU:0") | ) |
Construct an empty point cloud on the provided device.
| device | The device on which to initialize the point cloud (default: 'CPU:0'). |
Definition at line 49 of file PointCloud.cpp.
Referenced by CreateFromDepthImage(), CreateFromRGBDImage(), Crop(), FarthestPointDownSample(), and RemoveStatisticalOutliers().
| cloudViewer::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).
| points | A tensor with element shape {3}. |
Definition at line 54 of file PointCloud.cpp.
References AssertTensorShape, cloudViewer::utility::nullopt, points, and SetPointPositions().
| cloudViewer::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.
| map_keys_to_tensors | A map of string to Tensor containing points and their attributes. point_dict must contain at least the "positions" key. |
Definition at line 60 of file PointCloud.cpp.
References AssertTensorShape, device_, LogError, and point_attr_.
|
inlineoverridevirtual |
Definition at line 105 of file PointCloud.h.
| PointCloud cloudViewer::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.
Definition at line 125 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorDtype, cloudViewer::core::Tensor::Clone(), cloudViewer::core::Tensor::Empty(), GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), HasPointAttr(), length(), LogError, point_attr_, cloudViewer::core::Tensor::SetItem(), SetPointAttr(), and cloudViewer::core::TensorKey::Slice().
Referenced by operator+().
|
inlineoverridevirtual |
Clear all data in the point cloud.
Implements cloudViewer::t::geometry::Geometry.
Definition at line 251 of file PointCloud.h.
References point_attr_.
Referenced by cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::io::ReadPointCloudFromSPLAT(), cloudViewer::t::io::ReadPointCloudFromTXT(), and cloudViewer::t::io::ReadPointCloudFromXYZI().
| PointCloud cloudViewer::t::geometry::PointCloud::Clone | ( | ) | const |
Returns copy of the point cloud on the same device.
Definition at line 123 of file PointCloud.cpp.
References GetDevice(), and To().
Referenced by Crop(), cloudViewer::t::pipelines::registration::EvaluateRegistration(), FarthestPointDownSample(), cloudViewer::t::pipelines::slac::GetCorrespondenceSetForPointCloudPair(), cloudViewer::t::pipelines::registration::GetInformationMatrix(), cloudViewer::t::pipelines::registration::InitializePointCloudPyramidForMultiScaleICP(), cloudViewer::t::geometry::pybind_pointcloud(), and cloudViewer::t::pipelines::slac::VisualizePointCloudCorrespondences().
| core::Tensor cloudViewer::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.
| eps | Density parameter that is used to find neighbouring points. |
| min_points | Minimum number of points to form a cluster. |
| print_progress | If true the progress is visualized in the console. |
Definition at line 1174 of file PointCloud.cpp.
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| std::tuple< PointCloud, core::Tensor > cloudViewer::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.
| radius | Neighbor search radius parameter. |
| max_nn | Neighbor search max neighbors parameter [Default = 30]. |
| angle_threshold | Angle threshold to decide if a point is on the boundary [Default = 90.0]. |
Definition at line 574 of file PointCloud.cpp.
References AssertTensorDtypes, cloudViewer::core::Bool, cloudViewer::t::geometry::kernel::pointcloud::ComputeBoundaryPointsCPU(), cloudViewer::core::Tensor::Contiguous(), CUDA_CALL, cloudViewer::core::Float32, cloudViewer::core::Float64, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointNormals(), GetPointPositions(), HasPointNormals(), cloudViewer::core::nns::NearestNeighborSearch::HybridIndex(), cloudViewer::core::nns::NearestNeighborSearch::HybridSearch(), cloudViewer::core::Int32, cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogDebug, LogError, SelectByMask(), and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::geometry::ComputeBoundaryPoints(), and cloudViewer::t::geometry::pybind_pointcloud().
| TriangleMesh cloudViewer::t::geometry::PointCloud::ComputeConvexHull | ( | bool | joggle_inputs = false | ) | const |
Compute the convex hull of a point cloud using qhull.
This runs on the CPU.
| 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. |
Definition at line 1201 of file PointCloud.cpp.
References copy, cloudViewer::core::Float64, cloudViewer::core::Tensor::GetDataPtr(), GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), cloudViewer::core::Int32, LogError, cloudViewer::t::geometry::TriangleMesh::SetVertexAttr(), std::swap(), To(), and cloudViewer::t::geometry::TriangleMesh::To().
Referenced by cloudViewer::t::geometry::TriangleMesh::ComputeConvexHull(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBJylanki(), and cloudViewer::t::geometry::pybind_pointcloud().
| core::Tensor cloudViewer::t::geometry::PointCloud::ComputeMetrics | ( | const PointCloud & | pcd2, |
| std::vector< Metric > | metrics = {Metric::ChamferDistance}, |
||
| MetricParameters | params = MetricParameters() |
||
| ) | const |
Compute various metrics between two point clouds. Currently, Chamfer distance, Hausdorff distance and F-Score [[Knapitsch2017]] are supported. The Chamfer distance is the sum of the mean distance to the nearest neighbor from the points of the first point cloud to the second point cloud. The F-Score at a fixed threshold radius is the harmonic mean of the Precision and Recall. Recall is the percentage of surface points from the first point cloud that have the second point cloud points within the threshold radius, while Precision is the percentage of points from the second point cloud that have the first point cloud points within the threshold radius.
| pcd2 | Other point cloud to compare with. |
| metrics | List of Metric s to compute. Multiple metrics can be computed at once for efficiency. |
| params | MetricParameters struct holds parameters required by different metrics. |
Definition at line 1332 of file PointCloud.cpp.
References cloudViewer::t::geometry::ComputeMetricsCommon(), GetPointPositions(), cloudViewer::core::IsDevice::IsCPU(), IsEmpty(), cloudViewer::core::nns::NearestNeighborSearch::KnnIndex(), cloudViewer::core::nns::NearestNeighborSearch::KnnSearch(), LogError, LogWarning, params, cloudViewer::core::Tensor::Sqrt_(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
inline |
Backward-compatible convenience method to obtain a CPU-resident copy.
Definition at line 245 of file PointCloud.h.
References To().
Referenced by cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry().
|
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:
| depth | The input depth image should be a uint16_t or float image. |
| intrinsics | Intrinsic parameters of the camera. |
| extrinsics | Extrinsic parameters of the camera. |
| depth_scale | The depth is scaled by 1 / depth_scale. |
| depth_max | Truncated at depth_max distance. |
| stride | Sampling 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_normals | Also 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. |
Definition at line 956 of file PointCloud.cpp.
References AssertTensorDtypes, AssertTensorShape, cloudViewer::t::geometry::Image::AsTensor(), cloudViewer::t::geometry::CreatePointCloudWithNormals(), cloudViewer::core::Float64, cloudViewer::utility::nullopt, PointCloud(), points, stride, cloudViewer::core::Tensor::To(), and cloudViewer::t::geometry::kernel::pointcloud::Unproject().
Referenced by cloudViewer::t::pipelines::slac::ControlGrid::Deform(), and cloudViewer::t::geometry::pybind_pointcloud().
|
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:
| rgbd_image | The input RGBD image should have a uint16_t or float depth image and RGB image with any DType and the same size. |
| intrinsics | Intrinsic parameters of the camera. |
| extrinsics | Extrinsic parameters of the camera. |
| depth_scale | The depth is scaled by 1 / depth_scale. |
| depth_max | Truncated at depth_max distance. |
| stride | Sampling 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_normals | Also 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. |
Definition at line 986 of file PointCloud.cpp.
References AssertTensorDtypes, AssertTensorShape, cloudViewer::t::geometry::Image::AsTensor(), cloudViewer::t::geometry::RGBDImage::color_, colors, cloudViewer::t::geometry::CreatePointCloudWithNormals(), cloudViewer::t::geometry::RGBDImage::depth_, cloudViewer::core::Float32, PointCloud(), points, stride, cloudViewer::t::geometry::Image::To(), and cloudViewer::t::geometry::kernel::pointcloud::Unproject().
Referenced by cloudViewer::t::pipelines::slac::ControlGrid::Deform(), and cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::t::geometry::PointCloud::Crop | ( | const AxisAlignedBoundingBox & | aabb, |
| bool | invert = false |
||
| ) | const |
Function to crop pointcloud into output pointcloud.
| aabb | AxisAlignedBoundingBox to crop points. |
| invert | Crop the points outside of the bounding box or inside of the bounding box. |
Definition at line 1296 of file PointCloud.cpp.
References AssertTensorDevice, Clone(), cloudViewer::t::geometry::AxisAlignedBoundingBox::GetDevice(), GetDevice(), cloudViewer::t::geometry::AxisAlignedBoundingBox::GetPointIndicesWithinBoundingBox(), GetPointPositions(), cloudViewer::t::geometry::AxisAlignedBoundingBox::IsEmpty(), LogWarning, PointCloud(), and SelectByIndex().
Referenced by cloudViewer::t::geometry::CropByAxisAlignedBox(), cloudViewer::t::geometry::CropByOrientedBox(), and cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::t::geometry::PointCloud::Crop | ( | const OrientedBoundingBox & | obb, |
| bool | invert = false |
||
| ) | const |
Function to crop pointcloud into output pointcloud.
| obb | OrientedBoundingBox to crop points. |
| invert | Crop the points outside of the bounding box or inside of the bounding box. |
Definition at line 1310 of file PointCloud.cpp.
References AssertTensorDevice, Clone(), cloudViewer::t::geometry::OrientedBoundingBox::GetDevice(), GetDevice(), cloudViewer::t::geometry::OrientedBoundingBox::GetPointIndicesWithinBoundingBox(), GetPointPositions(), cloudViewer::t::geometry::OrientedBoundingBox::IsEmpty(), LogWarning, PointCloud(), and SelectByIndex().
| void cloudViewer::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.
| max_nn | [optional] Neighbor search max neighbors parameter [Default = 30]. |
| radius | [optional] Neighbor search radius parameter to use HybridSearch. [Recommended ~1.4x voxel size]. |
Definition at line 781 of file PointCloud.cpp.
References AssertTensorDtypes, CUDA_CALL, cloudViewer::core::Tensor::Empty(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingHybridSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingKNNSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateColorGradientsUsingRadiusSearchCPU(), cloudViewer::core::Float32, cloudViewer::core::Float64, GetDevice(), cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointColors(), GetPointNormals(), GetPointPositions(), cloudViewer::utility::optional< T >::has_value(), HasPointAttr(), HasPointColors(), HasPointNormals(), cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogDebug, LogError, SetPointAttr(), and cloudViewer::utility::optional< T >::value().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| void cloudViewer::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.
| max_nn | [optional] Neighbor search max neighbors parameter [Default = 30]. |
| radius | [optional] Neighbor search radius parameter. [Recommended ~1.4x voxel size]. |
Definition at line 619 of file PointCloud.cpp.
References AssertTensorDtype, AssertTensorDtypes, CUDA_CALL, cloudViewer::core::Tensor::Empty(), cloudViewer::t::geometry::kernel::pointcloud::EstimateCovariancesUsingHybridSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateCovariancesUsingKNNSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateCovariancesUsingRadiusSearchCPU(), cloudViewer::t::geometry::kernel::pointcloud::EstimateNormalsFromCovariancesCPU(), cloudViewer::core::Float32, cloudViewer::core::Float64, GetDevice(), cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointNormals(), GetPointPositions(), has_normals, cloudViewer::utility::optional< T >::has_value(), HasPointNormals(), cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogDebug, LogError, RemovePointAttr(), SetPointAttr(), SetPointNormals(), and cloudViewer::utility::optional< T >::value().
Referenced by cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::geometry::EstimateNormals(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), and cloudViewer::t::geometry::pybind_pointcloud().
| LineSet cloudViewer::t::geometry::PointCloud::ExtrudeLinear | ( | const core::Tensor & | vector, |
| double | scale = 1.0, |
||
| bool | capping = true |
||
| ) | const |
Sweeps the point cloud along a direction vector.
| vector | The direction vector. |
| scale | Scalar factor which essentially scales the direction vector. |
| capping | If true adds caps to the mesh. |
Definition at line 1289 of file PointCloud.cpp.
References cloudViewer::t::geometry::vtkutils::ExtrudeLinearLineSet().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| LineSet cloudViewer::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.
| angle | The rotation angle in degree. |
| axis | The rotation axis. |
| resolution | The resolution defines the number of intermediate sweeps about the rotation axis. |
| translation | The translation along the rotation axis. |
| capping | If true adds caps to the mesh. |
Definition at line 1279 of file PointCloud.cpp.
References cloudViewer::t::geometry::vtkutils::ExtrudeRotationLineSet().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::t::geometry::PointCloud::FarthestPointDownSample | ( | const size_t | num_samples, |
| const size_t | start_index = 0 |
||
| ) | 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, starting from start_index.
| num_samples | Number of points to be sampled. |
| start_index | Index to start downsampling from. |
Definition at line 388 of file PointCloud.cpp.
References cloudViewer::core::Bool, Clone(), cloudViewer::core::Tensor::Full(), GetDevice(), cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), infinity(), LogError, cloudViewer::core::Minimum(), PointCloud(), SelectByMask(), and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
static |
Create a PointCloud from a legacy CloudViewer PointCloud.
Definition at line 1074 of file PointCloud.cpp.
References cloudViewer::core::eigen_converter::EigenVector3dVectorToTensor(), ccPointCloud::getEigenColors(), ccPointCloud::getEigenNormals(), cloudViewer::PointCloudTpl< T >::getEigenPoints(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), cloudViewer::GenericCloud::hasPoints(), LogWarning, SetPointColors(), SetPointNormals(), and SetPointPositions().
Referenced by cloudViewer::t::pipelines::slac::CreateTPCDFromFile(), cloudViewer::t::geometry::FromLegacyPointCloud(), and cloudViewer::t::geometry::pybind_pointcloud().
| int cloudViewer::t::geometry::PointCloud::GaussianSplatGetSHOrder | ( | ) | const |
Returns the order of spherical harmonics used for Gaussian Splatting. Returns 0 if f_rest is not present.
| If | point cloud has f_rest 3DGS attribute, with the wrong shape. |
Definition at line 1381 of file PointCloud.cpp.
References AssertTensorShape, cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), cloudViewer::core::Tensor::GetShape(), LogError, cloudViewer::core::None, and point_attr_.
Referenced by cloudViewer::visualization::rendering::TGaussianSplatBuffersBuilder::ConstructBuffers(), and IsGaussianSplat().
| AxisAlignedBoundingBox cloudViewer::t::geometry::PointCloud::GetAxisAlignedBoundingBox | ( | ) | const |
Create an axis-aligned bounding box from attribute "positions".
Definition at line 1271 of file PointCloud.cpp.
References cloudViewer::t::geometry::AxisAlignedBoundingBox::CreateFromPoints(), and GetPointPositions().
Referenced by cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), and cloudViewer::t::geometry::pybind_pointcloud().
| core::Tensor cloudViewer::t::geometry::PointCloud::GetCenter | ( | ) | const |
Returns the center for point coordinates.
Definition at line 108 of file PointCloud.cpp.
References GetPointPositions(), and cloudViewer::core::Tensor::Mean().
Referenced by cloudViewer::t::geometry::pybind_pointcloud(), and Translate().
|
inlineoverridevirtual |
Returns the device attribute of this PointCloud.
Implements cloudViewer::t::geometry::Geometry.
Definition at line 421 of file PointCloud.h.
References device_.
Referenced by Append(), Clone(), ComputeBoundaryPoints(), ComputeConvexHull(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), Crop(), EstimateColorGradients(), EstimateNormals(), cloudViewer::t::pipelines::registration::EvaluateRegistration(), FarthestPointDownSample(), cloudViewer::t::pipelines::slac::GetCorrespondenceSetForPointCloudPair(), cloudViewer::t::pipelines::registration::GetInformationMatrix(), HiddenPointRemoval(), cloudViewer::t::pipelines::registration::MultiScaleICP(), OrientNormalsToAlignWithDirection(), OrientNormalsTowardsCameraLocation(), PaintUniformColor(), PCAPartition(), cloudViewer::t::geometry::pybind_pointcloud(), RandomDownSample(), cloudViewer::t::io::ReadPointCloudFromPLY(), RemoveRadiusOutliers(), RemoveStatisticalOutliers(), Scale(), SegmentPlane(), SelectByIndex(), SelectByMask(), To(), ToString(), Translate(), and UniformDownSample().
| core::Tensor cloudViewer::t::geometry::PointCloud::GetMaxBound | ( | ) | const |
Returns the max bound for point coordinates.
Definition at line 104 of file PointCloud.cpp.
References GetPointPositions(), and cloudViewer::core::Tensor::Max().
Referenced by cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ComputeAABB(), and cloudViewer::t::geometry::pybind_pointcloud().
| core::Tensor cloudViewer::t::geometry::PointCloud::GetMinBound | ( | ) | const |
Returns the min bound for point coordinates.
Definition at line 100 of file PointCloud.cpp.
References GetPointPositions(), and cloudViewer::core::Tensor::Min().
Referenced by cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ComputeAABB(), and cloudViewer::t::geometry::pybind_pointcloud().
| OrientedBoundingBox cloudViewer::t::geometry::PointCloud::GetOrientedBoundingBox | ( | ) | const |
Create an oriented bounding box from attribute "positions".
Definition at line 1275 of file PointCloud.cpp.
References cloudViewer::t::geometry::OrientedBoundingBox::CreateFromPoints(), and GetPointPositions().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
inline |
Getter for point_attr_ TensorMap.
Definition at line 114 of file PointCloud.h.
References point_attr_.
|
inline |
Getter for point_attr_ TensorMap. Used in Pybind.
Definition at line 111 of file PointCloud.h.
References point_attr_.
Referenced by Append(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::visualization::rendering::TGaussianSplatBuffersBuilder::ConstructBuffers(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateColorGradients(), EstimateNormals(), cloudViewer::t::pipelines::slac::FillInSLACAlignmentTerm(), GaussianSplatGetSHOrder(), cloudViewer::t::io::GenerateHeader(), cloudViewer::io::rpc::GeometryToMeshData(), GetPointColors(), GetPointNormals(), GetPointPositions(), HasPointAttr(), IsGaussianSplat(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::geometry::pybind_pointcloud(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloud(), cloudViewer::t::io::ReadPointCloudFromPLY(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::io::ReadPointCloudFromSPLAT(), SelectByIndex(), SelectByMask(), cloudViewer::visualization::rendering::TGaussianSplatBuffersBuilder::TGaussianSplatBuffersBuilder(), UniformDownSample(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), cloudViewer::t::pipelines::slac::VisualizePointCloudDeformation(), cloudViewer::t::pipelines::slac::VisualizePointCloudEmbedding(), cloudViewer::t::io::WritePCDData(), cloudViewer::t::io::WritePointCloudToNPZ(), cloudViewer::t::io::WritePointCloudToPLY(), cloudViewer::t::io::WritePointCloudToPTS(), cloudViewer::t::io::WritePointCloudToSPLAT(), cloudViewer::t::io::WritePointCloudToTXT(), and cloudViewer::t::io::WritePointCloudToXYZI().
|
inline |
Get attributes. Throws exception if the attribute does not exist.
| key | Attribute name. |
Definition at line 119 of file PointCloud.h.
References point_attr_.
|
inline |
Get attributes. Throws exception if the attribute does not exist.
| key | Attribute name. |
Definition at line 135 of file PointCloud.h.
References point_attr_.
|
inline |
Get the value of the "colors" attribute. Convenience function.
Definition at line 127 of file PointCloud.h.
References GetPointAttr().
Referenced by cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateColorGradients(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), ProjectToRGBDImage(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPTS(), ToLegacy(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), and cloudViewer::t::io::WritePointCloudToPTS().
|
inline |
Get the value of the "colors" attribute. Convenience function.
Definition at line 163 of file PointCloud.h.
References GetPointAttr().
|
inline |
Get the value of the "normals" attribute. Convenience function.
Definition at line 130 of file PointCloud.h.
References GetPointAttr().
Referenced by cloudViewer::t::geometry::ComputeBoundaryPoints(), ComputeBoundaryPoints(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), EstimateColorGradients(), EstimateNormals(), cloudViewer::t::pipelines::slac::FillInRigidAlignmentTerm(), cloudViewer::t::pipelines::slac::FillInSLACAlignmentTerm(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), NormalizeNormals(), OrientNormalsToAlignWithDirection(), OrientNormalsTowardsCameraLocation(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), cloudViewer::t::io::ReadPCDData(), Rotate(), ToLegacy(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), Transform(), and cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry().
|
inline |
Get the value of the "normals" attribute. Convenience function.
Definition at line 168 of file PointCloud.h.
References GetPointAttr().
|
inline |
Get the value of the "positions" attribute. Convenience function.
Definition at line 124 of file PointCloud.h.
References GetPointAttr().
Referenced by Append(), cloudViewer::t::pipelines::registration::AssertInputMultiScaleICP(), cloudViewer::t::geometry::ComputeBoundaryPoints(), ComputeBoundaryPoints(), ComputeConvexHull(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), ComputeMetrics(), cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), cloudViewer::t::pipelines::registration::ComputeRegistrationResult(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::visualization::rendering::TGaussianSplatBuffersBuilder::ConstructBuffers(), Crop(), cloudViewer::t::pipelines::registration::DoSingleScaleICPIterations(), EstimateColorGradients(), cloudViewer::t::geometry::EstimateNormals(), EstimateNormals(), cloudViewer::t::pipelines::registration::EvaluateRegistration(), FarthestPointDownSample(), cloudViewer::t::pipelines::slac::FillInRigidAlignmentTerm(), cloudViewer::t::pipelines::slac::FillInSLACAlignmentTerm(), GaussianSplatGetSHOrder(), cloudViewer::t::io::GenerateHeader(), GetAxisAlignedBoundingBox(), GetCenter(), cloudViewer::t::pipelines::slac::GetCorrespondenceSetForPointCloudPair(), cloudViewer::t::pipelines::registration::GetInformationMatrix(), GetMaxBound(), GetMinBound(), GetOrientedBoundingBox(), GetPoints(), cloudViewer::t::geometry::VoxelBlockGrid::GetUniqueBlockCoordinates(), HasPointAttr(), HiddenPointRemoval(), IsGaussianSplat(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::pipelines::registration::MultiScaleICP(), OrientNormalsToAlignWithDirection(), OrientNormalsTowardsCameraLocation(), PaintUniformColor(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), PCAPartition(), ProjectToDepthImage(), ProjectToRGBDImage(), RandomDownSample(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::io::ReadPointCloudFromSPLAT(), RemoveDuplicatedPoints(), RemoveNonFinitePoints(), RemoveRadiusOutliers(), RemoveStatisticalOutliers(), Rotate(), Scale(), cloudViewer::t::geometry::SelectByIndex(), SelectByIndex(), SelectByMask(), ToLegacy(), ToString(), cloudViewer::t::pipelines::slac::ControlGrid::Touch(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::t::geometry::Transform(), Transform(), Translate(), UniformDownSample(), cloudViewer::t::pipelines::slac::VisualizePointCloudEmbedding(), VoxelDownSample(), cloudViewer::t::io::WritePCDData(), cloudViewer::t::io::WritePointCloud(), cloudViewer::t::io::WritePointCloudToPCD(), cloudViewer::t::io::WritePointCloudToPLY(), cloudViewer::t::io::WritePointCloudToPTS(), cloudViewer::t::io::WritePointCloudToSPLAT(), and cloudViewer::t::io::WritePointCloudToTXT().
|
inline |
Get the value of the "positions" attribute. Convenience function.
Definition at line 140 of file PointCloud.h.
References GetPointAttr().
|
inline |
Backward-compatible getter for point positions (alias of GetPointPositions).
Definition at line 149 of file PointCloud.h.
References GetPointPositions().
Referenced by cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), and cloudViewer::t::io::WritePointCloudToXYZI().
|
inline |
Backward-compatible const getter for point positions.
Definition at line 152 of file PointCloud.h.
References GetPointPositions().
|
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
Definition at line 207 of file PointCloud.h.
References cloudViewer::t::geometry::TensorMap::Contains(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), and point_attr_.
Referenced by Append(), cloudViewer::t::pipelines::registration::AssertInputMultiScaleICP(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateColorGradients(), HasPointColors(), HasPointNormals(), HasPointPositions(), cloudViewer::t::pipelines::registration::InitializePointCloudPyramidForMultiScaleICP(), IsGaussianSplat(), SelectByIndex(), SelectByMask(), cloudViewer::visualization::rendering::TGaussianSplatBuffersBuilder::TGaussianSplatBuffersBuilder(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), cloudViewer::t::io::WritePointCloudToPTS(), and cloudViewer::t::io::WritePointCloudToXYZI().
|
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.
Definition at line 227 of file PointCloud.h.
References HasPointAttr().
Referenced by cloudViewer::t::pipelines::registration::AssertInputMultiScaleICP(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateColorGradients(), cloudViewer::t::io::GenerateHeader(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), ProjectToRGBDImage(), ToLegacy(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), cloudViewer::t::io::WritePCDData(), cloudViewer::t::io::WritePointCloudToPLY(), and cloudViewer::t::io::WritePointCloudToPTS().
|
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.
Definition at line 234 of file PointCloud.h.
References HasPointAttr().
Referenced by cloudViewer::t::pipelines::registration::AssertInputMultiScaleICP(), ComputeBoundaryPoints(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::ConstructBuffers(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateColorGradients(), cloudViewer::t::geometry::EstimateNormals(), EstimateNormals(), cloudViewer::t::io::GenerateHeader(), NormalizeNormals(), OrientNormalsConsistentTangentPlane(), OrientNormalsToAlignWithDirection(), OrientNormalsTowardsCameraLocation(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), Rotate(), ToLegacy(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), Transform(), cloudViewer::visualization::rendering::FilamentScene::UpdateGeometry(), cloudViewer::t::io::WritePCDData(), and cloudViewer::t::io::WritePointCloudToPLY().
|
inline |
Check if the "positions" attribute's value has length > 0. This is a convenience function.
Definition at line 220 of file PointCloud.h.
References HasPointAttr().
Referenced by cloudViewer::t::pipelines::registration::AssertInputMultiScaleICP(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeRMSE(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPoint::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationPointToPlane::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForColoredICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::TransformationEstimationForDopplerICP::ComputeTransformation(), cloudViewer::t::pipelines::registration::EvaluateRegistration(), cloudViewer::t::io::GenerateHeader(), cloudViewer::t::pipelines::registration::GetInformationMatrix(), HasPoints(), HiddenPointRemoval(), IsEmpty(), ProjectToDepthImage(), ProjectToRGBDImage(), ToLegacy(), and cloudViewer::t::io::WritePointCloudToPTS().
|
inline |
Backward-compatible presence check for point positions (alias of HasPointPositions).
Definition at line 160 of file PointCloud.h.
References HasPointPositions().
| std::tuple< TriangleMesh, core::Tensor > cloudViewer::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.
| camera_location | All points not visible from that location will be removed. |
| radius | The radius of the spherical projection. |
Definition at line 1161 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorShape, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), HasPointPositions(), and To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
inlineoverridevirtual |
Returns !HasPointPositions().
Implements cloudViewer::t::geometry::Geometry.
Definition at line 257 of file PointCloud.h.
References HasPointPositions().
Referenced by ComputeMetrics(), cloudViewer::t::io::WritePCDData(), cloudViewer::t::io::WritePointCloud(), cloudViewer::t::io::WritePointCloudToPLY(), cloudViewer::t::io::WritePointCloudToPTS(), and cloudViewer::t::io::WritePointCloudToSPLAT().
| bool cloudViewer::t::geometry::PointCloud::IsGaussianSplat | ( | ) | const |
Check if this point cloud has all the attributes required for a Gaussian Splat. This checks for the presence of scale, rot, opacity and f_dc attributes.
| If | point cloud has 3DGS attributes, but they are invalid (wrong shape). |
Definition at line 1365 of file PointCloud.cpp.
References AssertTensorShape, GaussianSplatGetSHOrder(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), and HasPointAttr().
Referenced by cloudViewer::visualization::rendering::GeometryBuffersBuilder::GetBuilder(), cloudViewer::t::io::ReadPointCloudFromPLY(), cloudViewer::t::io::WritePointCloudToPLY(), and cloudViewer::t::io::WritePointCloudToSPLAT().
| PointCloud & cloudViewer::t::geometry::PointCloud::NormalizeNormals | ( | ) |
Normalize point normals to length 1.
Definition at line 538 of file PointCloud.cpp.
References CUDA_CALL, GetPointNormals(), HasPointNormals(), cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogError, LogWarning, cloudViewer::t::geometry::kernel::pointcloud::NormalizeNormalsCPU(), normals, and SetPointNormals().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
inline |
operator+ for t::PointCloud appends the compatible attributes to the point cloud.
Definition at line 277 of file PointCloud.h.
References Append().
| void cloudViewer::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.
| k | k nearest neighbour for graph reconstruction for normal propagation. |
| lambda | penalty constant on the distance of a point from the tangent plane |
| cos_alpha_tol | treshold that defines the amplitude of the cone spanned by the reference normal |
Definition at line 766 of file PointCloud.cpp.
References HasPointNormals(), and LogWarning.
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| void cloudViewer::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.
| orientation_reference | Normals are oriented with respect to orientation_reference. |
Definition at line 713 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorShape, CUDA_CALL, GetDevice(), GetPointNormals(), GetPointPositions(), HasPointNormals(), cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogError, normals, cloudViewer::t::geometry::kernel::pointcloud::OrientNormalsToAlignWithDirectionCPU(), SetPointNormals(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| void cloudViewer::t::geometry::PointCloud::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.
| camera_location | Normals are oriented with towards the camera_location. |
Definition at line 740 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorShape, CUDA_CALL, GetDevice(), GetPointNormals(), GetPointPositions(), HasPointNormals(), cloudViewer::core::IsDevice::IsCPU(), cloudViewer::core::IsDevice::IsCUDA(), LogError, normals, cloudViewer::t::geometry::kernel::pointcloud::OrientNormalsTowardsCameraLocationCPU(), SetPointNormals(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud & cloudViewer::t::geometry::PointCloud::PaintUniformColor | ( | const core::Tensor & | color | ) |
Assigns uniform color to the point cloud.
| color | RGB color for the point cloud. {3,} shaped Tensor. Floating color values are clipped between 0.0 and 1.0. |
Definition at line 558 of file PointCloud.cpp.
References cloudViewer::core::Tensor::AsRvalue(), AssertTensorShape, color, cloudViewer::core::Tensor::Empty(), cloudViewer::core::Float32, cloudViewer::core::Float64, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), and SetPointColors().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| int cloudViewer::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".
| max_points | The maximum allowed number of points in a partition. |
Definition at line 1323 of file PointCloud.cpp.
References GetDevice(), GetPointPositions(), cloudViewer::t::geometry::kernel::pcapartition::PCAPartition(), SetPointAttr(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| geometry::Image cloudViewer::t::geometry::PointCloud::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 at line 1013 of file PointCloud.cpp.
References AssertTensorShape, device_, cloudViewer::core::Float32, GetPointPositions(), HasPointPositions(), height, LogWarning, cloudViewer::utility::nullopt, cloudViewer::t::geometry::kernel::pointcloud::Project(), width, and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::pipelines::slac::ControlGrid::Deform(), and cloudViewer::t::geometry::pybind_pointcloud().
| geometry::RGBDImage cloudViewer::t::geometry::PointCloud::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 at line 1036 of file PointCloud.cpp.
References AssertTensorShape, color, device_, cloudViewer::core::Float32, cloudViewer::core::Dtype::Float32, GetPointColors(), GetPointPositions(), HasPointColors(), HasPointPositions(), height, LogError, LogWarning, cloudViewer::t::geometry::kernel::pointcloud::Project(), cloudViewer::core::Dtype::UInt8, width, and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::pipelines::slac::ControlGrid::Deform(), and cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::t::geometry::PointCloud::RandomDownSample | ( | double | sampling_ratio | ) | const |
Downsample a pointcloud by selecting random index point and its attributes.
| sampling_ratio | Sampling ratio, the ratio of sample to total number of points in the pointcloud. |
Definition at line 363 of file PointCloud.cpp.
References GetDevice(), cloudViewer::utility::random::GetEngine(), cloudViewer::core::Tensor::GetLength(), cloudViewer::utility::random::GetMutex(), GetPointPositions(), cloudViewer::core::Int64, length(), LogError, and SelectByIndex().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| std::tuple< PointCloud, core::Tensor > cloudViewer::t::geometry::PointCloud::RemoveDuplicatedPoints | ( | ) | const |
Remove duplicated points and there associated attributes.
Definition at line 516 of file PointCloud.cpp.
References cloudViewer::core::Dtype::ByteSize(), device_, cloudViewer::core::Tensor::GetDtype(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), cloudViewer::core::HashSet::Insert(), cloudViewer::core::Int32, cloudViewer::core::Int64, LogError, cloudViewer::core::Tensor::ReinterpretCast(), and SelectByMask().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| std::tuple< PointCloud, core::Tensor > cloudViewer::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.
| remove_nan | Remove NaN values from the PointCloud. |
| remove_infinite | Remove infinite values from the PointCloud. |
Definition at line 492 of file PointCloud.cpp.
References cloudViewer::core::Tensor::All(), cloudViewer::core::Bool, cloudViewer::core::Tensor::Full(), cloudViewer::core::Tensor::GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), cloudViewer::core::Tensor::IsFinite(), cloudViewer::core::Tensor::IsInf(), cloudViewer::core::Tensor::IsNan(), LogDebug, cloudViewer::core::Tensor::LogicalNot(), and SelectByMask().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
|
inline |
Removes point attribute by key value. Primary attribute "positions" cannot be removed. Throws warning if attribute key does not exists.
| key | Attribute name. |
Definition at line 216 of file PointCloud.h.
References cloudViewer::t::geometry::TensorMap::Erase(), and point_attr_.
Referenced by cloudViewer::t::geometry::EstimateNormals(), and EstimateNormals().
| std::tuple< PointCloud, core::Tensor > cloudViewer::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.
| nb_points | Number of neighbor points required within the radius. |
| search_radius | Radius of the sphere. |
Definition at line 426 of file PointCloud.cpp.
References cloudViewer::core::nns::NearestNeighborSearch::FixedRadiusIndex(), cloudViewer::core::nns::NearestNeighborSearch::FixedRadiusSearch(), cloudViewer::core::Tensor::Ge(), GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), LogError, SelectByMask(), size, cloudViewer::core::Tensor::Slice(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud(), and cloudViewer::t::geometry::RemoveRadiusOutliers().
| std::tuple< PointCloud, core::Tensor > cloudViewer::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.
| nb_neighbors | Number of neighbors around the target point. |
| std_ratio | Standard deviation ratio. |
Definition at line 454 of file PointCloud.cpp.
References cloudViewer::core::Bool, cloudViewer::core::Float64, GetDevice(), GetPointPositions(), cloudViewer::core::Tensor::GetShape(), cloudViewer::core::nns::NearestNeighborSearch::KnnIndex(), cloudViewer::core::nns::NearestNeighborSearch::KnnSearch(), cloudViewer::core::Tensor::Le(), LogError, cloudViewer::core::Tensor::Mean(), PointCloud(), SelectByMask(), cloudViewer::core::Tensor::Sqrt(), G3Point::std_dev(), and To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud(), and cloudViewer::t::geometry::RemoveStatisticalOutliers().
| PointCloud & cloudViewer::t::geometry::PointCloud::Rotate | ( | const core::Tensor & | R, |
| const core::Tensor & | center | ||
| ) |
Rotates the PointPositions and PointNormals (if exists).
| R | Rotation [Tensor of dim {3,3}]. Should be on the same device as the PointCloud |
| center | Center [Tensor of dim {3}] about which the PointCloud is to be scaled. Should be on the same device as the PointCloud |
Definition at line 206 of file PointCloud.cpp.
References AssertTensorShape, GetPointNormals(), GetPointPositions(), HasPointNormals(), cloudViewer::t::geometry::kernel::transform::RotateNormals(), and cloudViewer::t::geometry::kernel::transform::RotatePoints().
Referenced by cloudViewer::t::geometry::kernel::minimum_obb::ComputeMinimumOBBApprox(), and cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud & cloudViewer::t::geometry::PointCloud::Scale | ( | double | scale, |
| const core::Tensor & | center | ||
| ) |
Scales the PointPositions of the PointCloud.
| scale | Scale [double] of dimension |
| center | Center [Tensor of dim {3}] about which the PointCloud is to be scaled. Should be on the same device as the PointCloud |
Definition at line 196 of file PointCloud.cpp.
References cloudViewer::core::Tensor::Add_(), AssertTensorShape, GetDevice(), GetPointPositions(), cloudViewer::core::Tensor::Mul_(), cloudViewer::core::Tensor::Sub_(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| std::tuple< core::Tensor, core::Tensor > cloudViewer::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.
| distance_threshold | Max distance a point can be from the plane model, and still be considered an inlier. |
| ransac_n | Number of initial points to be considered inliers in each iteration. |
| num_iterations | Maximum number of iterations. |
| probability | Expected probability of finding the optimal plane. |
Definition at line 1186 of file PointCloud.cpp.
References cloudViewer::core::Float64, GetDevice(), cloudViewer::core::Int64, and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::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.
| indices | Int64 indexing tensor of shape {n,} containing index value that is to be selected. |
| invert | Set to True to invert the selection of indices, and also ignore the duplicated indices. |
| remove_duplicates | Set to True to remove the duplicated indices. |
Definition at line 245 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorDtype, cloudViewer::core::Bool, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), HasPointAttr(), cloudViewer::core::TensorKey::IndexTensor(), cloudViewer::core::Int64, length(), LogDebug, SelectByMask(), cloudViewer::core::Tensor::SetItem(), SetPointAttr(), and cloudViewer::core::Tensor::Zeros().
Referenced by Crop(), cloudViewer::t::geometry::pybind_pointcloud(), RandomDownSample(), and cloudViewer::t::geometry::SelectByIndex().
| PointCloud cloudViewer::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.
| boolean_mask | Boolean indexing tensor of shape {n,} containing true value for the indices that is to be selected. |
| invert | Set to True to invert the selection of indices. |
Definition at line 219 of file PointCloud.cpp.
References AssertTensorDevice, AssertTensorDtype, AssertTensorShape, cloudViewer::core::Dtype::Bool, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), HasPointAttr(), length(), LogDebug, cloudViewer::core::Tensor::LogicalNot(), and SetPointAttr().
Referenced by ComputeBoundaryPoints(), FarthestPointDownSample(), cloudViewer::t::geometry::pybind_pointcloud(), RemoveDuplicatedPoints(), RemoveNonFinitePoints(), RemoveRadiusOutliers(), RemoveStatisticalOutliers(), and SelectByIndex().
|
inline |
Set attributes. If the attribute key already exists, its value will be overwritten, otherwise, the new key will be created.
| key | Attribute name. |
| value | A tensor. |
Definition at line 177 of file PointCloud.h.
References device_, cloudViewer::core::Tensor::GetDevice(), LogError, point_attr_, and cloudViewer::core::Device::ToString().
Referenced by Append(), EstimateColorGradients(), EstimateNormals(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), PCAPartition(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPLY(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::io::ReadPointCloudFromSPLAT(), cloudViewer::t::io::ReadPointCloudFromTXT(), cloudViewer::t::io::ReadPointCloudFromXYZI(), SelectByIndex(), SelectByMask(), SetPointColors(), SetPointNormals(), SetPointPositions(), To(), UniformDownSample(), and VoxelDownSample().
|
inline |
Set the value of the "colors" attribute. Convenience function.
Definition at line 192 of file PointCloud.h.
References AssertTensorShape, cloudViewer::utility::nullopt, and SetPointAttr().
Referenced by cloudViewer::t::geometry::CreatePointCloudWithNormals(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), FromLegacy(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), PaintUniformColor(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::geometry::TriangleMesh::SamplePointsUniformly(), and cloudViewer::t::geometry::ToLegacyPointCloud().
|
inline |
Set the value of the "normals" attribute. Convenience function.
Definition at line 198 of file PointCloud.h.
References AssertTensorShape, cloudViewer::utility::nullopt, and SetPointAttr().
Referenced by cloudViewer::t::geometry::ComputeBoundaryPoints(), cloudViewer::t::pipelines::slac::ControlGrid::Deform(), EstimateNormals(), cloudViewer::t::pipelines::slac::FillInRigidAlignmentTerm(), cloudViewer::t::pipelines::slac::FillInSLACAlignmentTerm(), FromLegacy(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), NormalizeNormals(), OrientNormalsToAlignWithDirection(), OrientNormalsTowardsCameraLocation(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), cloudViewer::t::io::ReadPCDData(), and cloudViewer::t::geometry::TriangleMesh::SamplePointsUniformly().
|
inline |
Set the value of the "positions" attribute. Convenience function.
Definition at line 186 of file PointCloud.h.
References AssertTensorShape, cloudViewer::utility::nullopt, and SetPointAttr().
Referenced by cloudViewer::t::geometry::ComputeBoundaryPoints(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::geometry::EstimateNormals(), FromLegacy(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::pipelines::slac::ControlGrid::Parameterize(), PointCloud(), cloudViewer::t::io::ReadPCDData(), cloudViewer::t::io::ReadPointCloudFromPTS(), cloudViewer::t::io::ReadPointCloudFromSPLAT(), cloudViewer::t::io::ReadPointCloudFromTXT(), SetPoints(), and cloudViewer::t::geometry::ToLegacyPointCloud().
|
inline |
Backward-compatible setter for point positions (alias of SetPointPositions).
Definition at line 156 of file PointCloud.h.
References SetPointPositions().
Referenced by cloudViewer::t::geometry::vtkutils::CreateVtkPolyDataFromGeometry(), and cloudViewer::t::io::ReadPointCloudFromXYZI().
| PointCloud cloudViewer::t::geometry::PointCloud::To | ( | const core::Device & | device, |
| bool | copy = false |
||
| ) | const |
Transfer the point cloud to a specified device.
| device | The targeted device to convert to. |
| copy | If 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. |
Definition at line 112 of file PointCloud.cpp.
References copy, GetDevice(), point_attr_, and SetPointAttr().
Referenced by Clone(), cloudViewer::t::geometry::ComputeBoundaryPoints(), ComputeConvexHull(), cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), CPU(), cloudViewer::t::geometry::CropByAxisAlignedBox(), cloudViewer::t::geometry::CropByOrientedBox(), cloudViewer::t::geometry::EstimateNormals(), HiddenPointRemoval(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::geometry::pybind_pointcloud(), cloudViewer::t::geometry::RemoveRadiusOutliers(), cloudViewer::t::geometry::RemoveStatisticalOutliers(), RemoveStatisticalOutliers(), cloudViewer::t::geometry::TriangleMesh::SamplePointsUniformly(), cloudViewer::t::geometry::SelectByIndex(), cloudViewer::visualization::rendering::TPointCloudBuffersBuilder::TPointCloudBuffersBuilder(), cloudViewer::t::geometry::Transform(), cloudViewer::t::geometry::UniformDownSample(), cloudViewer::t::geometry::VoxelDownSample(), cloudViewer::t::io::WritePointCloud(), and cloudViewer::t::io::WritePointCloudToPLY().
| cloudViewer::geometry::PointCloud cloudViewer::t::geometry::PointCloud::ToLegacy | ( | ) | const |
Convert to a legacy CloudViewer PointCloud.
Definition at line 1099 of file PointCloud.cpp.
References ccPointCloud::addEigenColors(), ccPointCloud::addEigenNorms(), cloudViewer::PointCloudTpl< T >::addPoints(), cloudViewer::core::Float32, cloudViewer::core::Float64, cloudViewer::core::Tensor::GetDtype(), GetPointColors(), GetPointNormals(), GetPointPositions(), HasPointColors(), HasPointNormals(), HasPointPositions(), LogWarning, max(), ccPointCloud::reserveTheNormsTable(), ccPointCloud::reserveThePointsTable(), ccPointCloud::reserveTheRGBTable(), cloudViewer::core::eigen_converter::TensorToEigenVector3dVector(), cloudViewer::core::Tensor::To(), cloudViewer::core::Dtype::ToString(), cloudViewer::core::UInt16, and cloudViewer::core::UInt8.
Referenced by cloudViewer::t::geometry::pybind_pointcloud(), cloudViewer::t::geometry::ToLegacyPointCloud(), cloudViewer::t::pipelines::slac::VisualizeGridDeformation(), cloudViewer::t::pipelines::slac::VisualizePointCloudCorrespondences(), cloudViewer::t::pipelines::slac::VisualizePointCloudDeformation(), cloudViewer::t::pipelines::slac::VisualizePointCloudEmbedding(), and cloudViewer::t::io::WritePointCloud().
| std::string cloudViewer::t::geometry::PointCloud::ToString | ( | ) | const |
Text description.
Definition at line 74 of file PointCloud.cpp.
References format, GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), cloudViewer::t::geometry::TensorMap::GetPrimaryKey(), and point_attr_.
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud & cloudViewer::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'
| transformation | Transformation [Tensor of dim {4,4}]. |
Definition at line 171 of file PointCloud.cpp.
References AssertTensorShape, GetPointNormals(), GetPointPositions(), HasPointNormals(), cloudViewer::t::geometry::kernel::transform::TransformNormals(), and cloudViewer::t::geometry::kernel::transform::TransformPoints().
Referenced by cloudViewer::t::pipelines::registration::DoSingleScaleICPIterations(), cloudViewer::t::pipelines::registration::EvaluateRegistration(), cloudViewer::t::pipelines::slac::FillInRigidAlignmentTerm(), cloudViewer::t::pipelines::slac::GetCorrespondenceSetForPointCloudPair(), cloudViewer::t::pipelines::registration::GetInformationMatrix(), cloudViewer::t::geometry::pybind_pointcloud(), cloudViewer::t::geometry::Transform(), and cloudViewer::t::pipelines::slac::VisualizePointCloudCorrespondences().
| PointCloud & cloudViewer::t::geometry::PointCloud::Translate | ( | const core::Tensor & | translation, |
| bool | relative = true |
||
| ) |
Translates the PointPositions of the PointCloud.
| translation | translation tensor of dimension {3} Should be on the same device as the PointCloud |
| relative | if true (default): translates relative to Center |
Definition at line 182 of file PointCloud.cpp.
References AssertTensorShape, GetCenter(), GetDevice(), GetPointPositions(), and cloudViewer::core::Tensor::To().
Referenced by cloudViewer::t::geometry::pybind_pointcloud().
| PointCloud cloudViewer::t::geometry::PointCloud::UniformDownSample | ( | size_t | every_k_points | ) | const |
Downsamples a point cloud by selecting every kth index point and its attributes.
| every_k_points | Sample rate, the selected point indices are [0, k, 2k, …]. |
Definition at line 345 of file PointCloud.cpp.
References GetDevice(), cloudViewer::core::Tensor::GetLength(), GetPointAttr(), GetPointPositions(), length(), LogError, and SetPointAttr().
Referenced by cloudViewer::t::pipelines::registration::ComputeFPFHFeature(), cloudViewer::t::geometry::pybind_pointcloud(), and cloudViewer::t::geometry::UniformDownSample().
| PointCloud cloudViewer::t::geometry::PointCloud::VoxelDownSample | ( | double | voxel_size, |
| const std::string & | reduction = "mean" |
||
| ) | const |
Downsamples a point cloud with a specified voxel size.
| voxel_size | Voxel size. A positive number. |
| reduction | Reduction type. Currently only support "mean". |
Definition at line 280 of file PointCloud.cpp.
References device_, cloudViewer::core::HashSet::Find(), cloudViewer::core::Float32, cloudViewer::core::Tensor::Floor(), cloudViewer::core::Tensor::GetLength(), GetPointPositions(), cloudViewer::core::Tensor::IndexAdd_(), cloudViewer::core::HashSet::Insert(), cloudViewer::core::Int64, LogError, cloudViewer::core::Tensor::Ones(), point_attr_, SetPointAttr(), cloudViewer::core::HashSet::Size(), cloudViewer::core::Tensor::To(), and cloudViewer::core::Tensor::Zeros().
Referenced by cloudViewer::t::geometry::EstimateNormals(), cloudViewer::t::pipelines::registration::InitializePointCloudPyramidForMultiScaleICP(), cloudViewer::t::pipelines::registration::LoadTensorDopplerPointCloudFromFile(), cloudViewer::t::pipelines::registration::LoadTensorPointCloudFromFile(), cloudViewer::t::geometry::RemoveRadiusOutliers(), cloudViewer::t::geometry::RemoveStatisticalOutliers(), and cloudViewer::t::geometry::VoxelDownSample().
|
protected |
Definition at line 778 of file PointCloud.h.
Referenced by GetDevice(), PointCloud(), ProjectToDepthImage(), ProjectToRGBDImage(), RemoveDuplicatedPoints(), SetPointAttr(), and VoxelDownSample().
|
protected |
Definition at line 779 of file PointCloud.h.
Referenced by Append(), Clear(), GaussianSplatGetSHOrder(), GetPointAttr(), HasPointAttr(), PointCloud(), RemovePointAttr(), SetPointAttr(), To(), ToString(), and VoxelDownSample().