Open3D (C++ API)
Public Member Functions | Static Public Member Functions | Data Fields
open3d::geometry::PointCloud Class Reference

A point cloud consists of point coordinates, and optionally point colors and point normals. More...

#include <PointCloud.h>

Inheritance diagram for open3d::geometry::PointCloud:
open3d::geometry::Geometry3D open3d::geometry::Geometry

Public Member Functions

 PointCloud ()
 Default Constructor. More...
 
 PointCloud (const std::vector< Eigen::Vector3d > &points)
 Parameterized Constructor. More...
 
 ~PointCloud () override
 
PointCloudClear () override
 Clear all elements in the geometry. More...
 
bool IsEmpty () const override
 Returns true iff the geometry is empty. More...
 
Eigen::Vector3d GetMinBound () const override
 Returns min bounds for geometry coordinates. More...
 
Eigen::Vector3d GetMaxBound () const override
 Returns max bounds for geometry coordinates. More...
 
Eigen::Vector3d GetCenter () const override
 Returns the center of the geometry coordinates. More...
 
AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const override
 Returns an axis-aligned bounding box of the geometry. More...
 
OrientedBoundingBox GetOrientedBoundingBox () const override
 Returns an oriented bounding box of the geometry. More...
 
PointCloudTransform (const Eigen::Matrix4d &transformation) override
 Apply transformation (4x4 matrix) to the geometry coordinates. More...
 
PointCloudTranslate (const Eigen::Vector3d &translation, bool relative=true) override
 Apply translation to the geometry coordinates. More...
 
PointCloudScale (const double scale, const Eigen::Vector3d &center) override
 Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$. More...
 
PointCloudRotate (const Eigen::Matrix3d &R, const Eigen::Vector3d &center) override
 Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$. More...
 
PointCloudoperator+= (const PointCloud &cloud)
 
PointCloud operator+ (const PointCloud &cloud) const
 
bool HasPoints () const
 Returns 'true' if the point cloud contains points. More...
 
bool HasNormals () const
 Returns true if the point cloud contains point normals. More...
 
bool HasColors () const
 Returns true if the point cloud contains point colors. More...
 
PointCloudNormalizeNormals ()
 Normalize point normals to length 1. More...
 
PointCloudPaintUniformColor (const Eigen::Vector3d &color)
 
PointCloudRemoveNonFinitePoints (bool remove_nan=true, bool remove_infinite=true)
 Remove all points fromt he point cloud that have a nan entry, or infinite entries. More...
 
std::shared_ptr< PointCloudSelectByIndex (const std::vector< size_t > &indices, bool invert=false) const
 Function to select points from input pointcloud into output pointcloud. More...
 
std::shared_ptr< PointCloudVoxelDownSample (double voxel_size) const
 Function to downsample input pointcloud into output pointcloud with a voxel. More...
 
std::tuple< std::shared_ptr< PointCloud >, Eigen::MatrixXi, std::vector< std::vector< int > > > VoxelDownSampleAndTrace (double voxel_size, const Eigen::Vector3d &min_bound, const Eigen::Vector3d &max_bound, bool approximate_class=false) const
 Function to downsample using geometry.PointCloud.VoxelDownSample. More...
 
std::shared_ptr< PointCloudUniformDownSample (size_t every_k_points) const
 Function to downsample input pointcloud into output pointcloud uniformly. More...
 
std::shared_ptr< PointCloudCrop (const AxisAlignedBoundingBox &bbox) const
 Function to crop pointcloud into output pointcloud. More...
 
std::shared_ptr< PointCloudCrop (const OrientedBoundingBox &bbox) const
 Function to crop pointcloud into output pointcloud. More...
 
std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > RemoveRadiusOutliers (size_t nb_points, double search_radius) const
 Function to remove points that have less than nb_points in a sphere of a given radius. More...
 
std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > RemoveStatisticalOutliers (size_t nb_neighbors, double std_ratio) const
 Function to remove points that are further away from their nb_neighbor neighbors in average. More...
 
bool EstimateNormals (const KDTreeSearchParam &search_param=KDTreeSearchParamKNN(), bool fast_normal_computation=true)
 Function to compute the normals of a point cloud. More...
 
bool OrientNormalsToAlignWithDirection (const Eigen::Vector3d &orientation_reference=Eigen::Vector3d(0.0, 0.0, 1.0))
 Function to orient the normals of a point cloud. More...
 
bool OrientNormalsTowardsCameraLocation (const Eigen::Vector3d &camera_location=Eigen::Vector3d::Zero())
 Function to orient the normals of a point cloud. More...
 
std::vector< double > ComputePointCloudDistance (const PointCloud &target)
 Function to compute the point to point distances between point clouds. More...
 
std::tuple< Eigen::Vector3d, Eigen::Matrix3d > ComputeMeanAndCovariance () const
 
std::vector< double > ComputeMahalanobisDistance () const
 Function to compute the Mahalanobis distance for points in an input point cloud. More...
 
std::vector< double > ComputeNearestNeighborDistance () const
 
std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > ComputeConvexHull () const
 Function that computes the convex hull of the point cloud using qhull. More...
 
std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > HiddenPointRemoval (const Eigen::Vector3d &camera_location, const 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...
 
std::vector< int > 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. More...
 
std::tuple< Eigen::Vector4d, std::vector< size_t > > SegmentPlane (const double distance_threshold=0.01, const int ransac_n=3, const int num_iterations=100) const
 Segment PointCloud plane using the RANSAC algorithm. More...
 
std::shared_ptr< PointCloudCreateFromVoxelGrid (const VoxelGrid &voxel_grid)
 Function to create a PointCloud from a VoxelGrid. More...
 
- Public Member Functions inherited from open3d::geometry::Geometry3D
 ~Geometry3D () override
 
- Public Member Functions inherited from open3d::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)
 

Static Public Member Functions

static std::shared_ptr< PointCloudCreateFromDepthImage (const Image &depth, const camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic=Eigen::Matrix4d::Identity(), double depth_scale=1000.0, double depth_trunc=1000.0, int stride=1, bool project_valid_depth_only=true)
 Factory function to create a pointcloud from a depth image and a camera model. More...
 
static std::shared_ptr< PointCloudCreateFromRGBDImage (const RGBDImage &image, const camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic=Eigen::Matrix4d::Identity(), bool project_valid_depth_only=true)
 Factory function to create a pointcloud from an RGB-D image and a camera model. More...
 
- Static Public Member Functions inherited from open3d::geometry::Geometry3D
static Eigen::Matrix3d GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XYZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YZX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZXY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from XZY RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from ZYX RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from YXZ RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation)
 Get Rotation Matrix from AxisAngle RotationType. More...
 
static Eigen::Matrix3d GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation)
 Get Rotation Matrix from Quaternion. More...
 

Data Fields

std::vector< Eigen::Vector3d > points_
 RGB colors of points. More...
 
std::vector< Eigen::Vector3d > normals_
 Points normals. More...
 
std::vector< Eigen::Vector3d > colors_
 Points coordinates. More...
 

Additional Inherited Members

- Public Types inherited from open3d::geometry::Geometry
enum  GeometryType {
  GeometryType::Unspecified = 0, GeometryType::PointCloud = 1, GeometryType::VoxelGrid = 2, GeometryType::Octree = 3,
  GeometryType::LineSet = 4, GeometryType::MeshBase = 5, GeometryType::TriangleMesh = 6, GeometryType::HalfEdgeTriangleMesh = 7,
  GeometryType::Image = 8, GeometryType::RGBDImage = 9, GeometryType::TetraMesh = 10, GeometryType::OrientedBoundingBox = 11,
  GeometryType::AxisAlignedBoundingBox = 12
}
 Specifies possible geometry types. More...
 
- Protected Member Functions inherited from open3d::geometry::Geometry3D
 Geometry3D (GeometryType type)
 Parameterized Constructor. More...
 
Eigen::Vector3d ComputeMinBound (const std::vector< Eigen::Vector3d > &points) const
 Compute min bound of a list points. More...
 
Eigen::Vector3d ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) const
 Compute max bound of a list points. More...
 
Eigen::Vector3d ComputeCenter (const std::vector< Eigen::Vector3d > &points) const
 Computer center of a list of points. More...
 
void ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, const size_t size, const Eigen::Vector3d &color) const
 Resizes the colors vector and paints a uniform color. More...
 
void TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) const
 Transforms all points with the transformation matrix. More...
 
void TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) const
 Transforms the normals with the transformation matrix. More...
 
void TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) const
 Apply translation to the geometry coordinates. More...
 
void ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Scale the coordinates of all points by the scaling factor scale. More...
 
void RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d &center) const
 Rotate all points with the rotation matrix R. More...
 
void RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) const
 Rotate all normals with the rotation matrix R. More...
 
- Protected Member Functions inherited from open3d::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 Parameterized Constructor. More...
 

Detailed Description

A point cloud consists of point coordinates, and optionally point colors and point normals.

Constructor & Destructor Documentation

◆ PointCloud() [1/2]

open3d::geometry::PointCloud::PointCloud ( )
inline

Default Constructor.

◆ PointCloud() [2/2]

open3d::geometry::PointCloud::PointCloud ( const std::vector< Eigen::Vector3d > &  points)
inline

Parameterized Constructor.

Parameters
pointsPoints coordinates.

◆ ~PointCloud()

open3d::geometry::PointCloud::~PointCloud ( )
inlineoverride

Member Function Documentation

◆ Clear()

PointCloud & open3d::geometry::PointCloud::Clear ( )
overridevirtual

Clear all elements in the geometry.

Implements open3d::geometry::Geometry3D.

◆ ClusterDBSCAN()

std::vector< int > open3d::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.

Returns a list of point labels, -1 indicates noise according to the algorithm.

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.

◆ ComputeConvexHull()

std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > open3d::geometry::PointCloud::ComputeConvexHull ( ) const

Function that computes the convex hull of the point cloud using qhull.

◆ ComputeMahalanobisDistance()

std::vector< double > open3d::geometry::PointCloud::ComputeMahalanobisDistance ( ) const

Function to compute the Mahalanobis distance for points in an input point cloud.

See: https://en.wikipedia.org/wiki/Mahalanobis_distance

◆ ComputeMeanAndCovariance()

std::tuple< Eigen::Vector3d, Eigen::Matrix3d > open3d::geometry::PointCloud::ComputeMeanAndCovariance ( ) const

Function to compute the mean and covariance matrix of a point cloud.

◆ ComputeNearestNeighborDistance()

std::vector< double > open3d::geometry::PointCloud::ComputeNearestNeighborDistance ( ) const

Function to compute the distance from a point to its nearest neighbor in the input point cloud

◆ ComputePointCloudDistance()

std::vector< double > open3d::geometry::PointCloud::ComputePointCloudDistance ( const PointCloud target)

Function to compute the point to point distances between point clouds.

For each point in the source point cloud, compute the distance to the target point cloud.

Parameters
targetThe target point cloud.

◆ CreateFromDepthImage()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::CreateFromDepthImage ( const Image depth,
const camera::PinholeCameraIntrinsic intrinsic,
const Eigen::Matrix4d &  extrinsic = Eigen::Matrix4d::Identity(),
double  depth_scale = 1000.0,
double  depth_trunc = 1000.0,
int  stride = 1,
bool  project_valid_depth_only = true 
)
static

Factory function to create a pointcloud 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 can be either a float image, or a uint16_t image.
intrinsicIntrinsic parameters of the camera.
extrinsicExtrinsic parameters of the camera.
depth_scaleThe depth is scaled by 1 / depth_scale.
depth_truncTruncated at depth_trunc distance.
strideSampling factor to support coarse point cloud extraction.
Returns
An empty pointcloud if the conversion fails. If
Parameters
project_valid_depth_onlyis true, return point cloud, which doesn't have nan point. If the value is false, return point cloud, which has a point for each pixel, whereas invalid depth results in NaN points.

◆ CreateFromRGBDImage()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::CreateFromRGBDImage ( const RGBDImage image,
const camera::PinholeCameraIntrinsic intrinsic,
const Eigen::Matrix4d &  extrinsic = Eigen::Matrix4d::Identity(),
bool  project_valid_depth_only = true 
)
static

Factory function to create a pointcloud 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
imageThe input image.
intrinsicIntrinsic parameters of the camera.
extrinsicExtrinsic parameters of the camera.
Returns
An empty pointcloud if the conversion fails. If
Parameters
project_valid_depth_onlyis true, return point cloud, which doesn't have nan point. If the value is false, return point cloud, which has a point for each pixel, whereas invalid depth results in NaN points.

◆ CreateFromVoxelGrid()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::CreateFromVoxelGrid ( const VoxelGrid voxel_grid)

Function to create a PointCloud from a VoxelGrid.

It transforms the voxel centers to 3D points using the original point cloud coordinate (with respect to the center of the voxel grid).

Parameters
voxel_gridThe input VoxelGrid.

◆ Crop() [1/2]

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::Crop ( const AxisAlignedBoundingBox bbox) const

Function to crop pointcloud into output pointcloud.

All points with coordinates outside the bounding box bbox are clipped.

Parameters
bboxAxisAlignedBoundingBox to crop points.

◆ Crop() [2/2]

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::Crop ( const OrientedBoundingBox bbox) const

Function to crop pointcloud into output pointcloud.

All points with coordinates outside the bounding box bbox are clipped.

Parameters
bboxOrientedBoundingBox to crop points.

◆ EstimateNormals()

bool open3d::geometry::PointCloud::EstimateNormals ( const KDTreeSearchParam search_param = KDTreeSearchParamKNN(),
bool  fast_normal_computation = true 
)

Function to compute the normals of a point cloud.

Normals are oriented with respect to the input point cloud if normals exist.

Parameters
search_paramThe KDTree search parameters for neighborhood search.
fast_normal_computationIf true, the normal estiamtion uses a non-iterative method to extract the eigenvector from the covariance matrix. This is faster, but is not as numerical stable.

◆ GetAxisAlignedBoundingBox()

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

Returns an axis-aligned bounding box of the geometry.

Implements open3d::geometry::Geometry3D.

◆ GetCenter()

Eigen::Vector3d open3d::geometry::PointCloud::GetCenter ( ) const
overridevirtual

Returns the center of the geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMaxBound()

Eigen::Vector3d open3d::geometry::PointCloud::GetMaxBound ( ) const
overridevirtual

Returns max bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetMinBound()

Eigen::Vector3d open3d::geometry::PointCloud::GetMinBound ( ) const
overridevirtual

Returns min bounds for geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ GetOrientedBoundingBox()

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

Returns an oriented bounding box of the geometry.

Implements open3d::geometry::Geometry3D.

◆ HasColors()

bool open3d::geometry::PointCloud::HasColors ( ) const
inline

Returns true if the point cloud contains point colors.

◆ HasNormals()

bool open3d::geometry::PointCloud::HasNormals ( ) const
inline

Returns true if the point cloud contains point normals.

◆ HasPoints()

bool open3d::geometry::PointCloud::HasPoints ( ) const
inline

Returns 'true' if the point cloud contains points.

◆ HiddenPointRemoval()

std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > open3d::geometry::PointCloud::HiddenPointRemoval ( const Eigen::Vector3d &  camera_location,
const 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.

Parameters
camera_locationAll points not visible from that location will be removed.
radiusThe radius of the sperical projection.

◆ IsEmpty()

bool open3d::geometry::PointCloud::IsEmpty ( ) const
overridevirtual

Returns true iff the geometry is empty.

Implements open3d::geometry::Geometry3D.

◆ NormalizeNormals()

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

Normalize point normals to length 1.

◆ operator+()

PointCloud open3d::geometry::PointCloud::operator+ ( const PointCloud cloud) const

◆ operator+=()

PointCloud & open3d::geometry::PointCloud::operator+= ( const PointCloud cloud)

◆ OrientNormalsToAlignWithDirection()

bool open3d::geometry::PointCloud::OrientNormalsToAlignWithDirection ( const Eigen::Vector3d &  orientation_reference = Eigen::Vector3d(0.0, 0.0, 1.0))

Function to orient the normals of a point cloud.

Parameters
orientation_referenceNormals are oriented with respect to orientation_reference.

◆ OrientNormalsTowardsCameraLocation()

bool open3d::geometry::PointCloud::OrientNormalsTowardsCameraLocation ( const Eigen::Vector3d &  camera_location = Eigen::Vector3d::Zero())

Function to orient the normals of a point cloud.

Parameters
camera_locationNormals are oriented with towards the camera_location.

◆ PaintUniformColor()

PointCloud& open3d::geometry::PointCloud::PaintUniformColor ( const Eigen::Vector3d &  color)
inline

Assigns each point in the PointCloud the same color.

Parameters
colorRGB colors of points.

◆ RemoveNonFinitePoints()

PointCloud & open3d::geometry::PointCloud::RemoveNonFinitePoints ( bool  remove_nan = true,
bool  remove_infinite = true 
)

Remove all points fromt he point cloud that have a nan entry, or infinite entries.

Also removes the corresponding normals and color entries.

Parameters
remove_nanRemove NaN values from the PointCloud.
remove_infiniteRemove infinite values from the PointCloud.

◆ RemoveRadiusOutliers()

std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > open3d::geometry::PointCloud::RemoveRadiusOutliers ( size_t  nb_points,
double  search_radius 
) const

Function to remove points that have less than nb_points in a sphere of a given radius.

Parameters
nb_pointsNumber of points within the radius.
search_radiusRadius of the sphere.

◆ RemoveStatisticalOutliers()

std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > open3d::geometry::PointCloud::RemoveStatisticalOutliers ( size_t  nb_neighbors,
double  std_ratio 
) const

Function to remove points that are further away from their nb_neighbor neighbors in average.

Parameters
nb_neighborsNumber of neighbors around the target point.
std_ratioStandard deviation ratio.

◆ Rotate()

PointCloud & open3d::geometry::PointCloud::Rotate ( const Eigen::Matrix3d &  R,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply rotation to the geometry coordinates and normals. Given a rotation matrix $R$, and center $c$, a given point $p$ is transformed according to $R (p - c) + c$.

Parameters
RA 3x3 rotation matrix
centerRotation center that is used for the rotation.

Implements open3d::geometry::Geometry3D.

◆ Scale()

PointCloud & open3d::geometry::PointCloud::Scale ( const double  scale,
const Eigen::Vector3d &  center 
)
overridevirtual

Apply scaling to the geometry coordinates. Given a scaling factor $s$, and center $c$, a given point $p$ is transformed according to $s (p - c) + c$.

Parameters
scaleThe scale parameter that is multiplied to the points/vertices of the geometry.
centerScale center that is used to resize the geometry.

Implements open3d::geometry::Geometry3D.

◆ SegmentPlane()

std::tuple< Eigen::Vector4d, std::vector< size_t > > open3d::geometry::PointCloud::SegmentPlane ( const double  distance_threshold = 0.01,
const int  ransac_n = 3,
const int  num_iterations = 100 
) const

Segment PointCloud plane using the RANSAC algorithm.

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_iterationsNumber of iterations.
Returns
Returns the plane model ax + by + cz + d = 0 and the indices of the plane inliers.

◆ SelectByIndex()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::SelectByIndex ( const std::vector< size_t > &  indices,
bool  invert = false 
) const

Function to select points from input pointcloud into output pointcloud.

Points with indices in

Parameters
indicesare selected.
indicesIndices of points to be selected.
invertSet to True to invert the selection of indices.

◆ Transform()

PointCloud & open3d::geometry::PointCloud::Transform ( const Eigen::Matrix4d &  transformation)
overridevirtual

Apply transformation (4x4 matrix) to the geometry coordinates.

Implements open3d::geometry::Geometry3D.

◆ Translate()

PointCloud & open3d::geometry::PointCloud::Translate ( const Eigen::Vector3d &  translation,
bool  relative = true 
)
overridevirtual

Apply translation to the geometry coordinates.

Parameters
translationA 3D vector to transform the geometry.
relativeIf true, the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation.

Implements open3d::geometry::Geometry3D.

◆ UniformDownSample()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::UniformDownSample ( size_t  every_k_points) const

Function to downsample input pointcloud into output pointcloud uniformly.

The sample is performed in the order of the points with the 0-th point always chosen, not at random.

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

◆ VoxelDownSample()

std::shared_ptr< PointCloud > open3d::geometry::PointCloud::VoxelDownSample ( double  voxel_size) const

Function to downsample input pointcloud into output pointcloud with a voxel.

Normals and colors are averaged if they exist.

Parameters
voxel_sizeDefines the resolution of the voxel grid, smaller value leads to denser output point cloud.

◆ VoxelDownSampleAndTrace()

std::tuple< std::shared_ptr< PointCloud >, Eigen::MatrixXi, std::vector< std::vector< int > > > open3d::geometry::PointCloud::VoxelDownSampleAndTrace ( double  voxel_size,
const Eigen::Vector3d &  min_bound,
const Eigen::Vector3d &  max_bound,
bool  approximate_class = false 
) const

Function to downsample using geometry.PointCloud.VoxelDownSample.

Also records point cloud index before downsampling.

Parameters
voxel_sizeVoxel size to downsample into.
min_boundMinimum coordinate of voxel boundaries
max_boundMaximum coordinate of voxel boundaries
approximate_classWhether to approximate.

Field Documentation

◆ colors_

std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::colors_

Points coordinates.

◆ normals_

std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::normals_

Points normals.

◆ points_

std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::points_

RGB colors of points.


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