41 class PinholeCameraIntrinsic;
68 bool IsEmpty()
const override;
69 Eigen::Vector3d GetMinBound()
const override;
70 Eigen::Vector3d GetMaxBound()
const override;
71 Eigen::Vector3d GetCenter()
const override;
74 bool robust =
false)
const override;
75 PointCloud &Transform(
const Eigen::Matrix4d &transformation)
override;
76 PointCloud &Translate(
const Eigen::Vector3d &translation,
77 bool relative =
true)
override;
79 const Eigen::Vector3d ¢er)
override;
81 const Eigen::Vector3d ¢er)
override;
87 bool HasPoints()
const {
return points_.size() > 0; }
91 return points_.size() > 0 && normals_.size() == points_.size();
96 return points_.size() > 0 && colors_.size() == points_.size();
101 return !points_.empty() && covariances_.size() == points_.size();
106 for (
size_t i = 0; i < normals_.size(); i++) {
107 normals_[i].normalize();
116 ResizeAndPaintUniformColor(colors_, points_.size(),
color);
127 PointCloud &RemoveNonFinitePoints(
bool remove_nan =
true,
128 bool remove_infinite =
true);
137 std::shared_ptr<PointCloud> SelectByIndex(
138 const std::vector<size_t> &indices,
bool invert =
false)
const;
147 std::shared_ptr<PointCloud> VoxelDownSample(
double voxel_size)
const;
157 std::tuple<std::shared_ptr<PointCloud>,
159 std::vector<std::vector<int>>>
160 VoxelDownSampleAndTrace(
double voxel_size,
161 const Eigen::Vector3d &min_bound,
162 const Eigen::Vector3d &max_bound,
163 bool approximate_class =
false)
const;
173 std::shared_ptr<PointCloud> UniformDownSample(
size_t every_k_points)
const;
183 std::shared_ptr<PointCloud> RandomDownSample(
double sampling_ratio)
const;
206 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
207 RemoveRadiusOutliers(
size_t nb_points,
208 double search_radius,
209 bool print_progress =
false)
const;
216 std::tuple<std::shared_ptr<PointCloud>, std::vector<size_t>>
217 RemoveStatisticalOutliers(
size_t nb_neighbors,
219 bool print_progress =
false)
const;
231 void EstimateNormals(
233 bool fast_normal_computation =
true);
239 void OrientNormalsToAlignWithDirection(
240 const Eigen::Vector3d &orientation_reference =
241 Eigen::Vector3d(0.0, 0.0, 1.0));
247 void OrientNormalsTowardsCameraLocation(
248 const Eigen::Vector3d &camera_location = Eigen::Vector3d::Zero());
256 void OrientNormalsConsistentTangentPlane(
size_t k);
265 std::vector<double> ComputePointCloudDistance(
const PointCloud &target);
274 static std::vector<Eigen::Matrix3d> EstimatePerPointCovariances(
284 void EstimateCovariances(
296 std::vector<double> ComputeMahalanobisDistance()
const;
300 std::vector<double> ComputeNearestNeighborDistance()
const;
308 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
309 ComputeConvexHull(
bool joggle_inputs =
false)
const;
320 std::tuple<std::shared_ptr<TriangleMesh>, std::vector<size_t>>
321 HiddenPointRemoval(
const Eigen::Vector3d &camera_location,
322 const double radius)
const;
335 std::vector<int> ClusterDBSCAN(
double eps,
337 bool print_progress =
false)
const;
351 std::tuple<Eigen::Vector4d, std::vector<size_t>> SegmentPlane(
352 const double distance_threshold = 0.01,
353 const int ransac_n = 3,
354 const int num_iterations = 100,
376 static std::shared_ptr<PointCloud> CreateFromDepthImage(
379 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
380 double depth_scale = 1000.0,
381 double depth_trunc = 1000.0,
383 bool project_valid_depth_only =
true);
401 static std::shared_ptr<PointCloud> CreateFromRGBDImage(
404 const Eigen::Matrix4d &extrinsic = Eigen::Matrix4d::Identity(),
405 bool project_valid_depth_only =
true);
413 std::shared_ptr<PointCloud> CreateFromVoxelGrid(
constexpr nullopt_t nullopt
Definition: Optional.h:171
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:339
The base geometry class.
Definition: Geometry.h:37
bool HasCovariances() const
Returns 'true' if the point cloud contains per-point covariance matrix.
Definition: PointCloud.h:100
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:155
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:55
bool HasPoints() const
Returns 'true' if the point cloud contains points.
Definition: PointCloud.h:87
PointCloud & NormalizeNormals()
Normalize point normals to length 1.
Definition: PointCloud.h:105
std::vector< Eigen::Vector3d > points_
Points coordinates.
Definition: PointCloud.h:418
PointCloud()
Default Constructor.
Definition: PointCloud.h:58
math::float4 color
Definition: LineSetBuffers.cpp:64
PointCloud & PaintUniformColor(const Eigen::Vector3d &color)
Definition: PointCloud.h:115
std::vector< Eigen::Vector3d > colors_
RGB colors of points.
Definition: PointCloud.h:422
The base geometry class for 3D geometries.
Definition: Geometry3D.h:47
std::vector< Eigen::Matrix3d > covariances_
Covariance Matrix for each point.
Definition: PointCloud.h:424
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:184
Definition: Optional.h:79
std::vector< Eigen::Vector3d > normals_
Points normals.
Definition: PointCloud.h:420
bool HasNormals() const
Returns true if the point cloud contains point normals.
Definition: PointCloud.h:90
Definition: PinholeCameraIntrinsic.cpp:35
~PointCloud() override
Definition: PointCloud.h:64
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:1374
bool HasColors() const
Returns true if the point cloud contains point colors.
Definition: PointCloud.h:95
KDTree search parameters for pure KNN search.
Definition: KDTreeSearchParam.h:63
PointCloud(const std::vector< Eigen::Vector3d > &points)
Parameterized Constructor.
Definition: PointCloud.h:62
The Image class stores image with customizable width, height, num of channels and bytes per channel...
Definition: Image.h:53
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:228