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;
77 const Eigen::Vector3d ¢er)
override;
79 const Eigen::Vector3d ¢er)
override;
85 bool HasPoints()
const {
return points_.size() > 0; }
89 return points_.size() > 0 && normals_.size() == points_.size();
94 return points_.size() > 0 && colors_.size() == points_.size();
99 for (
size_t i = 0; i < normals_.size(); i++) {
100 normals_[i].normalize();
109 ResizeAndPaintUniformColor(colors_, points_.size(),
color);
120 PointCloud &RemoveNonFinitePoints(
bool remove_nan =
true,
121 bool remove_infinite =
true);
130 std::shared_ptr<PointCloud> SelectByIndex(
131 const std::vector<size_t> &indices,
bool invert =
false)
const;
140 std::shared_ptr<PointCloud> VoxelDownSample(
double voxel_size)
const;
150 std::tuple<std::shared_ptr<PointCloud>,
152 std::vector<std::vector<int>>>
153 VoxelDownSampleAndTrace(
double voxel_size,
154 const Eigen::Vector3d &min_bound,
155 const Eigen::Vector3d &max_bound,
156 bool approximate_class =
false)
const;
166 std::shared_ptr<PointCloud> UniformDownSample(
size_t every_k_points)
const;
189 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
190 RemoveRadiusOutliers(
size_t nb_points,
double search_radius)
const;
197 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
198 RemoveStatisticalOutliers(
size_t nb_neighbors,
double std_ratio)
const;
209 void EstimateNormals(
211 bool fast_normal_computation =
true);
217 void OrientNormalsToAlignWithDirection(
218 const Eigen::Vector3d &orientation_reference =
219 Eigen::Vector3d(0.0, 0.0, 1.0));
225 void OrientNormalsTowardsCameraLocation(
226 const Eigen::Vector3d &camera_location = Eigen::Vector3d::Zero());
234 void OrientNormalsConsistentTangentPlane(
size_t k);
243 std::vector<double> ComputePointCloudDistance(
const PointCloud &target);
254 std::vector<double> ComputeMahalanobisDistance()
const;
258 std::vector<double> ComputeNearestNeighborDistance()
const;
261 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
262 ComputeConvexHull()
const;
273 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
274 HiddenPointRemoval(
const Eigen::Vector3d &camera_location,
275 const double radius)
const;
288 std::vector<int> ClusterDBSCAN(
double eps,
290 bool print_progress =
false)
const;
301 std::tuple<Eigen::Vector4d, std::vector<size_t>> SegmentPlane(
302 const double distance_threshold = 0.01,
303 const int ransac_n = 3,
304 const int num_iterations = 100)
const;
325 static std::shared_ptr<PointCloud> CreateFromDepthImage(
328 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
329 double depth_scale = 1000.0,
330 double depth_trunc = 1000.0,
332 bool project_valid_depth_only =
true);
350 static std::shared_ptr<PointCloud> CreateFromRGBDImage(
353 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
354 bool project_valid_depth_only =
true);
362 std::shared_ptr<PointCloud> CreateFromVoxelGrid(
std::tuple< Eigen::Vector3d, Eigen::Matrix3d > ComputeMeanAndCovariance(const std::vector< Eigen::Vector3d > &points, const std::vector< IdxType > &indices)
Function to compute the mean and covariance matrix of a set of points.
Definition: Eigen.cpp:335
The base geometry class.
Definition: Geometry.h:37
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:149
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:85
PointCloud & NormalizeNormals()
Normalize point normals to length 1.
Definition: PointCloud.h:98
std::vector< Eigen::Vector3d > points_
Points coordinates.
Definition: PointCloud.h:367
PointCloud()
Default Constructor.
Definition: PointCloud.h:57
math::float4 color
Definition: LineSetBuffers.cpp:64
PointCloud & PaintUniformColor(const Eigen::Vector3d &color)
Definition: PointCloud.h:108
std::vector< Eigen::Vector3d > colors_
RGB colors of points.
Definition: PointCloud.h:371
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
size_t stride
Definition: TriangleMeshBuffers.cpp:183
std::vector< Eigen::Vector3d > normals_
Points normals.
Definition: PointCloud.h:369
bool HasNormals() const
Returns true if the point cloud contains point normals.
Definition: PointCloud.h:88
int points
Definition: FilePCD.cpp:73
Definition: PinholeCameraIntrinsic.cpp:35
~PointCloud() override
Definition: PointCloud.h:63
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:80
GeometryType
Specifies possible geometry types.
Definition: Geometry.h:42
Tensor operator+(T scalar_lhs, const Tensor &rhs)
Definition: Tensor.h:1137
bool HasColors() const
Returns true if the point cloud contains point colors.
Definition: PointCloud.h:93
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