40 class PinholeCameraIntrinsic;
67 bool IsEmpty()
const override;
68 Eigen::Vector3d GetMinBound()
const override;
69 Eigen::Vector3d GetMaxBound()
const override;
70 Eigen::Vector3d GetCenter()
const override;
73 PointCloud &Transform(
const Eigen::Matrix4d &transformation)
override;
74 PointCloud &Translate(
const Eigen::Vector3d &translation,
75 bool relative =
true)
override;
76 PointCloud &Scale(
const double scale,
bool center =
true)
override;
77 PointCloud &Rotate(
const Eigen::Matrix3d &R,
bool center =
true)
override;
83 bool HasPoints()
const {
return points_.size() > 0; }
87 return points_.size() > 0 && normals_.size() == points_.size();
92 return points_.size() > 0 && colors_.size() == points_.size();
97 for (
size_t i = 0; i < normals_.size(); i++) {
98 normals_[i].normalize();
107 ResizeAndPaintUniformColor(colors_, points_.size(), color);
118 PointCloud &RemoveNonFinitePoints(
bool remove_nan =
true,
119 bool remove_infinite =
true);
128 std::shared_ptr<PointCloud> SelectByIndex(
129 const std::vector<size_t> &indices,
bool invert =
false)
const;
138 std::shared_ptr<PointCloud> VoxelDownSample(
double voxel_size)
const;
148 std::tuple<std::shared_ptr<PointCloud>,
150 std::vector<std::vector<int>>>
151 VoxelDownSampleAndTrace(
double voxel_size,
152 const Eigen::Vector3d &min_bound,
153 const Eigen::Vector3d &max_bound,
154 bool approximate_class =
false)
const;
164 std::shared_ptr<PointCloud> UniformDownSample(
size_t every_k_points)
const;
187 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
188 RemoveRadiusOutliers(
size_t nb_points,
double search_radius)
const;
195 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
196 RemoveStatisticalOutliers(
size_t nb_neighbors,
double std_ratio)
const;
207 bool EstimateNormals(
209 bool fast_normal_computation =
true);
215 bool OrientNormalsToAlignWithDirection(
216 const Eigen::Vector3d &orientation_reference =
217 Eigen::Vector3d(0.0, 0.0, 1.0));
223 bool OrientNormalsTowardsCameraLocation(
224 const Eigen::Vector3d &camera_location = Eigen::Vector3d::Zero());
233 std::vector<double> ComputePointCloudDistance(
const PointCloud &target);
237 std::tuple<Eigen::Vector3d, Eigen::Matrix3d> ComputeMeanAndCovariance()
244 std::vector<double> ComputeMahalanobisDistance()
const;
248 std::vector<double> ComputeNearestNeighborDistance()
const;
251 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
252 ComputeConvexHull()
const;
263 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
264 HiddenPointRemoval(
const Eigen::Vector3d &camera_location,
265 const double radius)
const;
278 std::vector<int> ClusterDBSCAN(
double eps,
280 bool print_progress =
false)
const;
291 std::tuple<Eigen::Vector4d, std::vector<size_t>> SegmentPlane(
292 const double distance_threshold = 0.01,
293 const int ransac_n = 3,
294 const int num_iterations = 100)
const;
315 static std::shared_ptr<PointCloud> CreateFromDepthImage(
318 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
319 double depth_scale = 1000.0,
320 double depth_trunc = 1000.0,
322 bool project_valid_depth_only =
true);
340 static std::shared_ptr<PointCloud> CreateFromRGBDImage(
343 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
344 bool project_valid_depth_only =
true);
352 std::shared_ptr<PointCloud> CreateFromVoxelGrid(
The base geometry class.
Definition: Geometry.h:35
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:130
Contains the pinhole camera intrinsic parameters.
Definition: PinholeCameraIntrinsic.h:51
A bounding box oriented along an arbitrary frame of reference.
Definition: BoundingVolume.h:44
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
bool HasPoints() const
Returns 'true' if the point cloud contains points.
Definition: PointCloud.h:83
PointCloud & NormalizeNormals()
Normalize point normals to length 1.
Definition: PointCloud.h:96
std::vector< Eigen::Vector3d > points_
RGB colors of points.
Definition: PointCloud.h:357
PointCloud()
Default Constructor.
Definition: PointCloud.h:57
double voxel_size
Definition: FilePLY.cpp:285
PointCloud & PaintUniformColor(const Eigen::Vector3d &color)
Definition: PointCloud.h:106
Tensor operator+(T scalar_lhs, const Tensor &rhs)
Definition: Tensor.h:858
std::vector< Eigen::Vector3d > colors_
Points coordinates.
Definition: PointCloud.h:361
The base geometry class for 3D geometries.
Definition: Geometry3D.h:46
Base class for KDTree search parameters.
Definition: KDTreeSearchParam.h:35
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:46
std::vector< Eigen::Vector3d > normals_
Points normals.
Definition: PointCloud.h:359
bool HasNormals() const
Returns true if the point cloud contains point normals.
Definition: PointCloud.h:86
int points
Definition: FilePCD.cpp:70
Definition: Reduction.cpp:36
~PointCloud() override
Definition: PointCloud.h:63
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:81
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:40
bool HasColors() const
Returns true if the point cloud contains point colors.
Definition: PointCloud.h:91
KDTree search parameters for pure KNN search.
Definition: KDTreeSearchParam.h:63
PointCloud(const std::vector< Eigen::Vector3d > &points)
Parameterized Constructor.
Definition: PointCloud.h:61
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53