Open3D (C++ API)
0.18.0+252c867
|
A point cloud consists of point coordinates, and optionally point colors and point normals. More...
#include <PointCloud.h>
Public Member Functions | |
PointCloud () | |
Default Constructor. More... | |
PointCloud (const std::vector< Eigen::Vector3d > &points) | |
Parameterized Constructor. More... | |
~PointCloud () override | |
PointCloud & | Clear () 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 |
OrientedBoundingBox | GetOrientedBoundingBox (bool robust=false) const override |
OrientedBoundingBox | GetMinimalOrientedBoundingBox (bool robust=false) const override |
PointCloud & | Transform (const Eigen::Matrix4d &transformation) override |
Apply transformation (4x4 matrix) to the geometry coordinates. More... | |
PointCloud & | Translate (const Eigen::Vector3d &translation, bool relative=true) override |
Apply translation to the geometry coordinates. More... | |
PointCloud & | Scale (const double scale, const Eigen::Vector3d ¢er) 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... | |
PointCloud & | Rotate (const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) 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... | |
PointCloud & | operator+= (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... | |
bool | HasCovariances () const |
Returns 'true' if the point cloud contains per-point covariance matrix. More... | |
PointCloud & | NormalizeNormals () |
Normalize point normals to length 1. More... | |
PointCloud & | PaintUniformColor (const Eigen::Vector3d &color) |
PointCloud & | RemoveNonFinitePoints (bool remove_nan=true, bool remove_infinite=true) |
Removes all points from the point cloud that have a nan entry, or infinite entries. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing non-finite points. More... | |
PointCloud & | RemoveDuplicatedPoints () |
Removes duplicated points, i.e., points that have identical coordinates. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing duplicated points. More... | |
std::shared_ptr< PointCloud > | SelectByIndex (const std::vector< size_t > &indices, bool invert=false) const |
Selects points from input pointcloud, with indices in indices , and returns a new point-cloud with selected points. More... | |
std::shared_ptr< PointCloud > | VoxelDownSample (double voxel_size) const |
Downsample input pointcloud with a voxel, and return a new point-cloud. Normals, covariances and colors are averaged if they exist. 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< PointCloud > | UniformDownSample (size_t every_k_points) const |
Function to downsample input pointcloud into output pointcloud uniformly. More... | |
std::shared_ptr< PointCloud > | RandomDownSample (double sampling_ratio) const |
Function to downsample input pointcloud into output pointcloud randomly. More... | |
std::shared_ptr< PointCloud > | FarthestPointDownSample (size_t num_samples) const |
Function to downsample input pointcloud into output pointcloud with a set of points has farthest distance. More... | |
std::shared_ptr< PointCloud > | Crop (const AxisAlignedBoundingBox &bbox, bool invert=false) const |
Function to crop pointcloud into output pointcloud. More... | |
std::shared_ptr< PointCloud > | Crop (const OrientedBoundingBox &bbox, bool invert=false) 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, bool print_progress=false) 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, bool print_progress=false) const |
Function to remove points that are further away from their nb_neighbor neighbors in average. More... | |
void | EstimateNormals (const KDTreeSearchParam &search_param=KDTreeSearchParamKNN(), bool fast_normal_computation=true) |
Function to compute the normals of a point cloud. More... | |
void | OrientNormalsToAlignWithDirection (const Eigen::Vector3d &orientation_reference=Eigen::Vector3d(0.0, 0.0, 1.0)) |
Function to orient the normals of a point cloud. More... | |
void | OrientNormalsTowardsCameraLocation (const Eigen::Vector3d &camera_location=Eigen::Vector3d::Zero()) |
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... | |
std::vector< double > | ComputePointCloudDistance (const PointCloud &target) |
Function to compute the point to point distances between point clouds. More... | |
void | EstimateCovariances (const KDTreeSearchParam &search_param=KDTreeSearchParamKNN()) |
Function to compute the covariance matrix for each point of a point cloud. 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 (bool joggle_inputs=false) const |
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 double probability=0.99999999) const |
Segment PointCloud plane using the RANSAC algorithm. More... | |
std::vector< std::shared_ptr< OrientedBoundingBox > > | DetectPlanarPatches (double normal_variance_threshold_deg=60, double coplanarity_deg=75, double outlier_ratio=0.75, double min_plane_edge_length=0.0, size_t min_num_points=0, const geometry::KDTreeSearchParam &search_param=geometry::KDTreeSearchParamKNN()) const |
Robustly detect planar patches in the point cloud using. Araújo and Oliveira, “A robust statistics approach for plane detection in unorganized point clouds,” Pattern Recognition, 2020. More... | |
Public Member Functions inherited from open3d::geometry::Geometry3D | |
~Geometry3D () override | |
virtual Geometry3D & | Rotate (const Eigen::Matrix3d &R) |
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::vector< Eigen::Matrix3d > | EstimatePerPointCovariances (const PointCloud &input, const KDTreeSearchParam &search_param=KDTreeSearchParamKNN()) |
Static function to compute the covariance matrix for each point of a point cloud. Doesn't change the input PointCloud, just outputs the covariance matrices. More... | |
static std::shared_ptr< 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) |
Factory function to create a pointcloud from a depth image and a camera model. More... | |
static std::shared_ptr< PointCloud > | CreateFromRGBDImage (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 std::shared_ptr< PointCloud > | CreateFromVoxelGrid (const VoxelGrid &voxel_grid) |
Factory Function to create a PointCloud from a VoxelGrid. 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_ |
Points coordinates. More... | |
std::vector< Eigen::Vector3d > | normals_ |
Points normals. More... | |
std::vector< Eigen::Vector3d > | colors_ |
RGB colors of points. More... | |
std::vector< Eigen::Matrix3d > | covariances_ |
Covariance Matrix for each point. More... | |
Additional Inherited Members | |
Public Types inherited from open3d::geometry::Geometry | |
enum class | GeometryType { Unspecified = 0 , PointCloud = 1 , VoxelGrid = 2 , Octree = 3 , LineSet = 4 , MeshBase = 5 , TriangleMesh = 6 , HalfEdgeTriangleMesh = 7 , Image = 8 , RGBDImage = 9 , TetraMesh = 10 , OrientedBoundingBox = 11 , AxisAlignedBoundingBox = 12 } |
Specifies possible geometry types. More... | |
Protected Member Functions inherited from open3d::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 | TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) const |
Transforms all covariance matrices with the transformation. 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 ¢er) 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 ¢er) 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... | |
void | RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) const |
Rotate all covariance matrices with the rotation matrix R . More... | |
Protected Member Functions inherited from open3d::geometry::Geometry | |
Geometry (GeometryType type, int dimension) | |
Parameterized Constructor. More... | |
A point cloud consists of point coordinates, and optionally point colors and point normals.
|
inline |
Default Constructor.
|
inline |
Parameterized Constructor.
points | Points coordinates. |
|
inlineoverride |
|
overridevirtual |
Clear all elements in the geometry.
Implements open3d::geometry::Geometry3D.
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.
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. |
std::tuple< std::shared_ptr< TriangleMesh >, std::vector< size_t > > open3d::geometry::PointCloud::ComputeConvexHull | ( | bool | joggle_inputs = false | ) | const |
Function that computes the convex hull of the point cloud using qhull
joggle_inputs | If true allows the algorithm to add random noise to the points to work around degenerate inputs. This adds the 'QJ' option to the qhull command. |
std::vector< double > open3d::geometry::PointCloud::ComputeMahalanobisDistance | ( | ) | const |
Function to compute the Mahalanobis distance for points in an input point cloud.
std::tuple< Eigen::Vector3d, Eigen::Matrix3d > open3d::geometry::PointCloud::ComputeMeanAndCovariance | ( | ) | const |
Function to compute the mean and covariance matrix of a point cloud.
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
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.
target | The target point cloud. |
|
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
depth | The input depth image can be either a float image, or a uint16_t image. |
intrinsic | Intrinsic parameters of the camera. |
extrinsic | Extrinsic parameters of the camera. |
depth_scale | The depth is scaled by 1 / depth_scale . |
depth_trunc | Truncated at depth_trunc distance. |
stride | Sampling factor to support coarse point cloud extraction. |
project_valid_depth_only | is 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. |
|
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
image | The input image. |
intrinsic | Intrinsic parameters of the camera. |
extrinsic | Extrinsic parameters of the camera. |
project_valid_depth_only | is 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. |
|
static |
Factory 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).
voxel_grid | The input VoxelGrid. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::Crop | ( | const AxisAlignedBoundingBox & | bbox, |
bool | invert = false |
||
) | const |
Function to crop pointcloud into output pointcloud.
All points with coordinates outside the bounding box bbox
are clipped.
bbox | AxisAlignedBoundingBox to crop points. |
invert | Optional boolean to invert cropping. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::Crop | ( | const OrientedBoundingBox & | bbox, |
bool | invert = false |
||
) | const |
Function to crop pointcloud into output pointcloud.
All points with coordinates outside the bounding box bbox
are clipped.
bbox | OrientedBoundingBox to crop points. |
invert | Optional boolean to invert cropping. |
std::vector< std::shared_ptr< OrientedBoundingBox > > open3d::geometry::PointCloud::DetectPlanarPatches | ( | double | normal_variance_threshold_deg = 60 , |
double | coplanarity_deg = 75 , |
||
double | outlier_ratio = 0.75 , |
||
double | min_plane_edge_length = 0.0 , |
||
size_t | min_num_points = 0 , |
||
const geometry::KDTreeSearchParam & | search_param = geometry::KDTreeSearchParamKNN() |
||
) | const |
Robustly detect planar patches in the point cloud using. Araújo and Oliveira, “A robust statistics approach for plane detection in unorganized point clouds,” Pattern Recognition, 2020.
normal_variance_threshold_deg | Planes having point normals with high variance are rejected. The default value is 60 deg. Larger values would allow more noisy planes to be detected. |
coplanarity_deg | The curvature of plane detections are scored using the angle between the plane's normal vector and an auxiliary vector. An ideal plane would have a score of 90 deg. The default value for this threshold is 75 deg, and detected planes with scores lower than this are rejected. Large threshold values encourage a tighter distribution of points around the detected plane, i.e., less curvature. |
outlier_ratio | Maximum allowable ratio of outliers in associated plane points before plane is rejected. |
min_plane_edge_length | A patch's largest edge must greater than this value to be considered a true planar patch. If set to 0, defaults to 1% of largest span of point cloud. |
min_num_points | Determines how deep the associated octree becomes and how many points must be used for estimating a plane. If set to 0, defaults to 0.1% of the number of points in point cloud. |
search_param | Point neighbors are used to grow and merge detected planes. Neighbors are found with KDTree search using these params. More neighbors results in higher quality patches at the cost of compute. |
void open3d::geometry::PointCloud::EstimateCovariances | ( | const KDTreeSearchParam & | search_param = KDTreeSearchParamKNN() | ) |
Function to compute the covariance matrix for each point of a point cloud.
search_param | The KDTree search parameters for neighborhood search. |
void 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.
search_param | The KDTree search parameters for neighborhood search. |
fast_normal_computation | If true, the normal estimation uses a non-iterative method to extract the eigenvector from the covariance matrix. This is faster, but is not as numerical stable. |
|
static |
Static function to compute the covariance matrix for each point of a point cloud. Doesn't change the input PointCloud, just outputs the covariance matrices.
input | PointCloud to use for covariance computation |
search_param | The KDTree search parameters for neighborhood search. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::FarthestPointDownSample | ( | size_t | num_samples | ) | const |
Function to downsample input pointcloud into output pointcloud with a set of points has farthest distance.
The sample is performed by selecting the farthest point from previous selected points iteratively.
num_samples | Number of points to be sampled. |
|
overridevirtual |
Creates the axis-aligned bounding box around the points of the object. Further details in AxisAlignedBoundingBox::CreateFromPoints()
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Returns the center of the geometry coordinates.
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Returns max bounds for geometry coordinates.
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Returns min bounds for geometry coordinates.
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Creates the minimal oriented bounding box around the points of the object. Further details in OrientedBoundingBox::CreateFromPointsMinimal()
robust | If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates. |
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Creates an oriented bounding box around the points of the object. Further details in OrientedBoundingBox::CreateFromPoints()
robust | If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates. |
Implements open3d::geometry::Geometry3D.
|
inline |
Returns true
if the point cloud contains point colors.
|
inline |
Returns 'true' if the point cloud contains per-point covariance matrix.
|
inline |
Returns true
if the point cloud contains point normals.
|
inline |
Returns 'true' if the point cloud contains points.
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.
camera_location | All points not visible from that location will be removed. |
radius | The radius of the spherical projection. |
|
overridevirtual |
Returns true
iff the geometry is empty.
Implements open3d::geometry::Geometry3D.
|
inline |
Normalize point normals to length 1.
PointCloud open3d::geometry::PointCloud::operator+ | ( | const PointCloud & | cloud | ) | const |
PointCloud & open3d::geometry::PointCloud::operator+= | ( | const PointCloud & | cloud | ) |
void open3d::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 |
void 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.
orientation_reference | Normals are oriented with respect to orientation_reference. |
void open3d::geometry::PointCloud::OrientNormalsTowardsCameraLocation | ( | const Eigen::Vector3d & | camera_location = Eigen::Vector3d::Zero() | ) |
Function to orient the normals of a point cloud.
camera_location | Normals are oriented with towards the camera_location. |
|
inline |
Assigns each point in the PointCloud the same color.
color | RGB colors of points. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::RandomDownSample | ( | double | sampling_ratio | ) | const |
Function to downsample input pointcloud into output pointcloud randomly.
The sample is performed by randomly selecting the index of the points in the pointcloud.
sampling_ratio | Sampling ratio, the ratio of sample to total number of points in the pointcloud. |
PointCloud & open3d::geometry::PointCloud::RemoveDuplicatedPoints | ( | ) |
Removes duplicated points, i.e., points that have identical coordinates. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing duplicated points.
PointCloud & open3d::geometry::PointCloud::RemoveNonFinitePoints | ( | bool | remove_nan = true , |
bool | remove_infinite = true |
||
) |
Removes all points from the point cloud that have a nan entry, or infinite entries. It also removes the corresponding attributes associated with the non-finite point such as normals, covariances and color entries. It doesn't re-computes these attributes after removing non-finite points.
remove_nan | Remove NaN values from the PointCloud. |
remove_infinite | Remove infinite values from the PointCloud. |
std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > open3d::geometry::PointCloud::RemoveRadiusOutliers | ( | size_t | nb_points, |
double | search_radius, | ||
bool | print_progress = false |
||
) | const |
Function to remove points that have less than nb_points
in a sphere of a given radius.
nb_points | Number of points within the radius. |
search_radius | Radius of the sphere. |
print_progress | Whether to print the progress bar. |
std::tuple< std::shared_ptr< PointCloud >, std::vector< size_t > > open3d::geometry::PointCloud::RemoveStatisticalOutliers | ( | size_t | nb_neighbors, |
double | std_ratio, | ||
bool | print_progress = false |
||
) | const |
Function to remove points that are further away from their nb_neighbor
neighbors in average.
nb_neighbors | Number of neighbors around the target point. |
std_ratio | Standard deviation ratio. |
|
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\).
R | A 3x3 rotation matrix |
center | Rotation center that is used for the rotation. |
Implements open3d::geometry::Geometry3D.
|
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\).
scale | The scale parameter that is multiplied to the points/vertices of the geometry. |
center | Scale center that is used to resize the geometry. |
Implements open3d::geometry::Geometry3D.
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 double | probability = 0.99999999 |
||
) | const |
Segment PointCloud plane using the RANSAC algorithm.
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. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::SelectByIndex | ( | const std::vector< size_t > & | indices, |
bool | invert = false |
||
) | const |
Selects points from input
pointcloud, with indices in indices
, and returns a new point-cloud with selected points.
indices | Indices of points to be selected. |
invert | Set to True to invert the selection of indices. |
|
overridevirtual |
Apply transformation (4x4 matrix) to the geometry coordinates.
Implements open3d::geometry::Geometry3D.
|
overridevirtual |
Apply translation to the geometry coordinates.
translation | A 3D vector to transform the geometry. |
relative | If true , the translation is directly applied to the geometry. Otherwise, the geometry center is moved to the translation . |
Implements open3d::geometry::Geometry3D.
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.
every_k_points | Sample rate, the selected point indices are [0, k, 2k, …]. |
std::shared_ptr< PointCloud > open3d::geometry::PointCloud::VoxelDownSample | ( | double | voxel_size | ) | const |
Downsample input pointcloud with a voxel, and return a new point-cloud. Normals, covariances and colors are averaged if they exist.
voxel_size | Defines the resolution of the voxel grid, smaller value leads to denser output point cloud. |
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.
voxel_size | Voxel size to downsample into. |
min_bound | Minimum coordinate of voxel boundaries |
max_bound | Maximum coordinate of voxel boundaries |
approximate_class | Whether to approximate. |
std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::colors_ |
RGB colors of points.
std::vector<Eigen::Matrix3d> open3d::geometry::PointCloud::covariances_ |
Covariance Matrix for each point.
std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::normals_ |
Points normals.
std::vector<Eigen::Vector3d> open3d::geometry::PointCloud::points_ |
Points coordinates.