|
ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
|
Namespaces | |
| namespace | cgal |
Classes | |
| struct | WindowData |
| struct | DoorData |
| struct | WallData |
| struct | BuildingComponent |
| A detected or manual building component (window, door, wall, ...). More... | |
| struct | CellVertexData |
| struct | FaceData |
| struct | CellData |
| struct | VertexProperties |
| struct | CellEdgeData |
| class | CellComplex |
| struct | CoplanarPolygon |
| A closed 3D polygon whose vertices are coplanar. More... | |
| struct | WallCandidate |
| A connected component of approximately-vertical, coplanar mesh faces. More... | |
| struct | CreateWindowsOptions |
| Configuration for the create_windows pipeline. More... | |
| struct | CreateWindowsResult |
| Output of create_windows(). More... | |
| struct | MeshOptions |
| Options for mesh generation. More... | |
| struct | ReconstructionParams |
| Parameters for point cloud reconstruction from stored sensor frames. More... | |
| class | Registry |
| struct | PointCluster |
| struct | ScenePlane |
| struct | SceneObject |
| struct | SceneVertexData |
| struct | SceneEdgeData |
| class | SceneGraph |
| struct | SegmentInstancesRequest |
| Request structure for instance segmentation via Euclidean clustering. More... | |
| struct | SegmentInstancesResult |
| Result structure for instance segmentation. More... | |
| struct | SegmentPlanesOptions |
| struct | SegmentRoomsOptions |
| class | Solidifier |
| Solidifier solves room segmentation using Mixed Integer Programming. More... | |
| struct | CameraData |
| Camera data for texture mapping. More... | |
Typedefs | |
| template<typename Scalar> | |
| using | Plane = Eigen::Matrix<Scalar, 4, 1> |
| template<typename Scalar> | |
| using | PlaneVector |
Enumerations | |
| enum class | ComponentType { window , door , wall } |
| Discriminator for building component types. More... | |
| enum class | CellNodeType { cell , face , vertex } |
| enum class | WindowBoundaryMode { rectangle , polyline } |
| How to compute the window boundary polygon. More... | |
| enum class | SceneNodeType { point_cluster , plane , object } |
Functions | |
| std::string_view | to_string (ComponentType type) |
| ComponentType | component_type_from_string (std::string_view str) |
| std::string | component_data_to_json (const BuildingComponent &c) |
| Serialize the type-specific variant data to JSON TEXT. | |
| void | component_data_from_json (BuildingComponent &c, const std::string &json) |
| Deserialize JSON TEXT into the variant data on a BuildingComponent. | |
| std::vector< WallCandidate > | extract_wall_candidates (const pcl::PolygonMesh &mesh, float normal_z_threshold=0.3f, float coplanarity_angle_deg=10.0f) |
| Extract planar vertical wall candidates from a triangle mesh. | |
| CreateWindowsResult | create_windows (CloudConstPtr cloud, CloudLConstPtr instance_labels, const std::map< uint32_t, uint32_t > &instance_to_semantic, const pcl::PolygonMesh &mesh, const std::vector< uint32_t > &window_semantic_labels, const CreateWindowsOptions &options={}) |
| Create window BuildingComponents from instance-labeled points and wall geometry. | |
| void | apply_depth_discontinuity_filter (cv::Mat &depth, cv::Mat &confidence, float gradient_threshold=0.5f) |
| Remove "flying pixels" at depth discontinuity edges. | |
| void | apply_ray_consistency_filter (cv::Mat &depth, cv::Mat &confidence, float consistency_threshold=0.2f) |
| Remove isolated noisy depth measurements. | |
| pcl::PolygonMeshPtr | mesh (CloudConstPtr cloud, CloudNConstPtr normals, EigenVectorContainer< double, 4 > &planes, EigenVectorContainer< double, 3 > ¢roids, std::vector< IndicesPtr > &inliers, CloudLConstPtr rooms, MeshOptions const opt=MeshOptions{}) |
| Generate a mesh from point cloud and geometric primitives. | |
| void | reconstruct_point_clouds (ProjectDB &db, const ReconstructionParams ¶ms) |
| Generate merged point clouds from sensor frames stored in a ProjectDB. | |
| template<typename Scalar, typename PointT> | |
| auto | regularizePlanes (PlaneVector< Scalar > &planes, typename pcl::PointCloud< PointT >::ConstPtr points, std::vector< pcl::IndicesPtr > &inliers, double angle_threshold=25.0, double distance_threshold=0.01) |
| auto | segment_instances (const SegmentInstancesRequest &request) -> SegmentInstancesResult |
| Segment point cloud into instances using Euclidean clustering. | |
| auto | segment_instances_impl (const SegmentInstancesRequest &request) -> SegmentInstancesResult |
| Implementation function for segment_instances. | |
| auto | segment_planes_impl (CloudConstPtr cloud, CloudNConstPtr normals, const SegmentPlanesOptions &options) -> std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr > |
| auto | segment_planes (CloudConstPtr cloud, CloudNConstPtr normals, const SegmentPlanesOptions &options=SegmentPlanesOptions{}) -> std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr > |
| auto | segment_rooms_impl (CloudConstPtr cloud, CloudNConstPtr normals, CloudLConstPtr planes, const SegmentRoomsOptions &options) -> CloudLPtr |
| auto | segment_rooms (CloudConstPtr cloud, CloudNConstPtr normals, CloudLConstPtr planes, const SegmentRoomsOptions &options=SegmentRoomsOptions{}) -> CloudLPtr |
| pcl::TextureMesh::Ptr | texture_mesh_with_cloud (pcl::PolygonMesh::Ptr mesh, CloudConstPtr cloud) |
| pcl::TextureMesh::Ptr | texture_mesh (pcl::PolygonMesh::Ptr mesh, std::map< int, rtabmap::Transform > const &poses, std::map< int, rtabmap::Signature > const &nodes) |
| Texture mesh using RTABMap signatures (legacy API). | |
| pcl::TextureMesh::Ptr | texture_mesh (pcl::PolygonMesh::Ptr mesh, std::map< int, CameraData > const &cameras) |
| Texture mesh using simple camera data (ProjectDB API). | |
| pcl::PolygonMeshPtr | unweld_mesh (const pcl::PolygonMesh &mesh, float threshold_radians) |
| Unweld (split) mesh vertices along sharp edges. | |
| auto | dist_plane_point (const Eigen::Vector4d &plane, const Eigen::Vector3d &point) -> double |
| Calculate distance from a point to a plane. | |
| auto | make_pairs (EigenVectorContainer< double, 4 > &planes, std::vector< IndicesPtr > &inliers, EigenVectorContainer< double, 3 > ¢roids, const double threshold=0.6, const double new_plane_offset=0.5) -> std::vector< std::pair< size_t, size_t > > |
| Create pairs of opposite parallel planes. | |
| auto | force_orthogonal_planes (EigenVectorContainer< double, 4 > &planes, const double threshold=0.1, const Eigen::Matrix< double, 3, 1 > &up=Eigen::Matrix< double, 3, 1 >(0, 0, 1)) -> EigenVectorContainer< double, 4 > |
| Force planes to be orthogonal to a reference direction. | |
| auto | compute_number_of_inliers (CloudConstPtr cloud, Eigen::Vector4d const &plane, IndicesConstPtr indices, const float threshold=0.2) -> size_t |
| Count number of inliers for a plane. | |
| auto | merge_planes (EigenVectorContainer< double, 4 > const &planes_, std::vector< IndicesPtr > const &inliers_, EigenVectorContainer< double, 3 > const ¢roids_, CloudConstPtr cloud, const double angle_threshold=0.1, const double distance_threshold=0.5, const double min_overlap=0.8) -> std::tuple< EigenVectorContainer< double, 4 >, std::vector< IndicesPtr >, EigenVectorContainer< double, 3 > > |
| Merge similar planes based on angle, distance, and overlap. | |
| auto | separate_planes (const EigenVectorContainer< double, 4 > &planes, const Eigen::Vector3d &up=Eigen::Vector3d(0, 0, 1), const double epsilon=0.1) -> std::tuple< std::vector< size_t >, std::vector< size_t > > |
| Separate planes into horizontal and vertical based on up vector. | |
| template<typename CloudPtr> | |
| auto | compute_polygon_normal (const pcl::Vertices &poly, const CloudPtr &cloud) -> Eigen::Vector3f |
| Compute the normal vector of a polygon. | |
| using reusex::geometry::Plane = Eigen::Matrix<Scalar, 4, 1> |
Definition at line 70 of file regularization.hpp.
| using reusex::geometry::PlaneVector |
Definition at line 73 of file regularization.hpp.
|
strong |
| Enumerator | |
|---|---|
| cell | |
| face | |
| vertex | |
Definition at line 28 of file CellComplex.hpp.
|
strong |
Discriminator for building component types.
| Enumerator | |
|---|---|
| window | |
| door | |
| wall | |
Definition at line 17 of file BuildingComponent.hpp.
|
strong |
| Enumerator | |
|---|---|
| point_cluster | |
| plane | |
| object | |
Definition at line 31 of file SceneGraph.hpp.
|
strong |
How to compute the window boundary polygon.
| Enumerator | |
|---|---|
| rectangle | |
| polyline | |
Definition at line 34 of file create_windows.hpp.
| void reusex::geometry::apply_depth_discontinuity_filter | ( | cv::Mat & | depth, |
| cv::Mat & | confidence, | ||
| float | gradient_threshold = 0.5f ) |
Remove "flying pixels" at depth discontinuity edges.
Computes depth gradients via Sobel operators and zeros out pixels with gradient magnitudes exceeding gradient_threshold.
| depth | Input/output depth map (single-channel), modified in-place. |
| confidence | Input/output confidence map, modified in-place (may be empty). |
| gradient_threshold | Maximum allowed gradient in meters per pixel. |
| void reusex::geometry::apply_ray_consistency_filter | ( | cv::Mat & | depth, |
| cv::Mat & | confidence, | ||
| float | consistency_threshold = 0.2f ) |
Remove isolated noisy depth measurements.
Compares each pixel to the median of its 5x5 neighbourhood and zeros out pixels deviating by more than consistency_threshold.
| depth | Input/output depth map (single-channel), modified in-place. |
| confidence | Input/output confidence map, modified in-place (may be empty). |
| consistency_threshold | Maximum allowed deviation from neighbourhood median in meters. |
| void reusex::geometry::component_data_from_json | ( | BuildingComponent & | c, |
| const std::string & | json ) |
Deserialize JSON TEXT into the variant data on a BuildingComponent.
| std::string reusex::geometry::component_data_to_json | ( | const BuildingComponent & | c | ) |
Serialize the type-specific variant data to JSON TEXT.
| ComponentType reusex::geometry::component_type_from_string | ( | std::string_view | str | ) |
| auto reusex::geometry::compute_number_of_inliers | ( | CloudConstPtr | cloud, |
| Eigen::Vector4d const & | plane, | ||
| IndicesConstPtr | indices, | ||
| const float | threshold = 0.2 ) -> size_t |
Count number of inliers for a plane.
| cloud | Input point cloud. |
| plane | Plane coefficients. |
| indices | Point indices to check. |
| threshold | Distance threshold for inliers. Default 0.2. |
| auto reusex::geometry::compute_polygon_normal | ( | const pcl::Vertices & | poly, |
| const CloudPtr & | cloud ) -> Eigen::Vector3f |
Compute the normal vector of a polygon.
Calculates the normal vector of a polygon using the cross product sum method (also known as Newell's method). The normal is automatically normalized.
| CloudPtr | Point cloud pointer type (const or non-const, e.g., CloudLocConstPtr). |
| poly | Polygon with vertex indices. |
| cloud | Point cloud containing the vertices (read-only). |
| std::invalid_argument | if polygon has fewer than 3 vertices. |
| std::runtime_error | if polygon is degenerate (zero normal magnitude). |
| CreateWindowsResult reusex::geometry::create_windows | ( | CloudConstPtr | cloud, |
| CloudLConstPtr | instance_labels, | ||
| const std::map< uint32_t, uint32_t > & | instance_to_semantic, | ||
| const pcl::PolygonMesh & | mesh, | ||
| const std::vector< uint32_t > & | window_semantic_labels, | ||
| const CreateWindowsOptions & | options = {} ) |
Create window BuildingComponents from instance-labeled points and wall geometry.
For each window instance, projects its points onto the nearest wall plane, computes a boundary polygon (AABB or concave hull), and offsets it along the outward wall normal. Performs validation to filter out windows that intersect the mesh, are out of bounds, or are internal (optional).
References mesh().
| auto reusex::geometry::dist_plane_point | ( | const Eigen::Vector4d & | plane, |
| const Eigen::Vector3d & | point ) -> double |
Calculate distance from a point to a plane.
| plane | Plane coefficients (nx, ny, nz, d) where n is the normal. |
| point | 3D point coordinates. |
| std::vector< WallCandidate > reusex::geometry::extract_wall_candidates | ( | const pcl::PolygonMesh & | mesh, |
| float | normal_z_threshold = 0.3f, | ||
| float | coplanarity_angle_deg = 10.0f ) |
Extract planar vertical wall candidates from a triangle mesh.
Decomposes the mesh into connected components of approximately-vertical, coplanar faces. Each component becomes a WallCandidate with a fitted plane, centroid, outward normal, and boundary vertices.
References mesh().
| auto reusex::geometry::force_orthogonal_planes | ( | EigenVectorContainer< double, 4 > & | planes, |
| const double | threshold = 0.1, | ||
| const Eigen::Matrix< double, 3, 1 > & | up = Eigen::Matrix< double, 3, 1 >(0, 0, 1) ) -> EigenVectorContainer< double, 4 > |
Force planes to be orthogonal to a reference direction.
Adjusts plane normals to be either parallel or perpendicular to the up vector.
| planes | Plane coefficients to adjust. |
| threshold | Angular threshold for orthogonality. Default 0.1. |
| up | Reference up vector. Default (0, 0, 1). |
| auto reusex::geometry::make_pairs | ( | EigenVectorContainer< double, 4 > & | planes, |
| std::vector< IndicesPtr > & | inliers, | ||
| EigenVectorContainer< double, 3 > & | centroids, | ||
| const double | threshold = 0.6, | ||
| const double | new_plane_offset = 0.5 ) -> std::vector< std::pair< size_t, size_t > > |
Create pairs of opposite parallel planes.
Finds pairs of planes with opposite normals within a distance threshold. Creates new planes for unpaired planes.
| planes | Plane coefficients. |
| inliers | Indices of points belonging to each plane. |
| centroids | Plane centroids. |
| threshold | Maximum distance threshold for pairing. Default 0.6. |
| new_plane_offset | Offset for creating new planes. Default 0.5. |
| auto reusex::geometry::merge_planes | ( | EigenVectorContainer< double, 4 > const & | planes_, |
| std::vector< IndicesPtr > const & | inliers_, | ||
| EigenVectorContainer< double, 3 > const & | centroids_, | ||
| CloudConstPtr | cloud, | ||
| const double | angle_threshold = 0.1, | ||
| const double | distance_threshold = 0.5, | ||
| const double | min_overlap = 0.8 ) -> std::tuple< EigenVectorContainer< double, 4 >, std::vector< IndicesPtr >, EigenVectorContainer< double, 3 > > |
Merge similar planes based on angle, distance, and overlap.
| planes_ | Input plane coefficients. |
| inliers_ | Inliers for each plane. |
| centroids_ | Plane centroids. |
| cloud | Point cloud. |
| angle_threshold | Angular similarity threshold. Default 0.1. |
| distance_threshold | Distance threshold for merging. Default 0.5. |
| min_overlap | Minimum overlap ratio for merging. Default 0.8. |
| pcl::PolygonMeshPtr reusex::geometry::mesh | ( | CloudConstPtr | cloud, |
| CloudNConstPtr | normals, | ||
| EigenVectorContainer< double, 4 > & | planes, | ||
| EigenVectorContainer< double, 3 > & | centroids, | ||
| std::vector< IndicesPtr > & | inliers, | ||
| CloudLConstPtr | rooms, | ||
| MeshOptions const | opt = MeshOptions{} ) |
Generate a mesh from point cloud and geometric primitives.
| cloud | Input point cloud. |
| normals | Point cloud normals. |
| planes | Detected plane coefficients. |
| centroids | Plane centroids. |
| inliers | Indices of points belonging to each plane. |
| rooms | Room labels for points. |
| opt | Mesh generation options (includes optional filter). |
Referenced by create_windows(), reusex::geometry::cgal::decompose_mesh(), extract_wall_candidates(), texture_mesh(), texture_mesh(), texture_mesh_with_cloud(), and unweld_mesh().
| void reusex::geometry::reconstruct_point_clouds | ( | ProjectDB & | db, |
| const ReconstructionParams & | params ) |
Generate merged point clouds from sensor frames stored in a ProjectDB.
For each sensor frame the function reads depth, confidence, color, pose, and intrinsics; applies depth filters; performs custom pinhole back-projection; estimates normals; and accumulates into a single cloud. Post-processing includes voxelisation, NaN removal, label majority voting, statistical outlier removal, and radius outlier removal.
Results are saved into the ProjectDB as "cloud", "normals", and "labels".
| db | Project database (read/write). |
| params | Reconstruction parameters. |
| auto reusex::geometry::regularizePlanes | ( | PlaneVector< Scalar > & | planes, |
| typename pcl::PointCloud< PointT >::ConstPtr | points, | ||
| std::vector< pcl::IndicesPtr > & | inliers, | ||
| double | angle_threshold = 25.0, | ||
| double | distance_threshold = 0.01 ) |
Definition at line 77 of file regularization.hpp.
References reusex::trace().
| auto reusex::geometry::segment_instances | ( | const SegmentInstancesRequest & | request | ) | -> SegmentInstancesResult |
Segment point cloud into instances using Euclidean clustering.
Applies PCL's Euclidean clustering algorithm within each semantic class to separate spatially-disconnected regions into distinct instances.
Algorithm:
| request | Configuration and input data |
| std::invalid_argument | if inputs are invalid |
| std::runtime_error | if cancellation requested |
| auto reusex::geometry::segment_instances_impl | ( | const SegmentInstancesRequest & | request | ) | -> SegmentInstancesResult |
Implementation function for segment_instances.
Separated for future enhancements (e.g., different clustering algorithms)
| auto reusex::geometry::segment_planes | ( | CloudConstPtr | cloud, |
| CloudNConstPtr | normals, | ||
| const SegmentPlanesOptions & | options = SegmentPlanesOptions{} ) -> std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr > |
| auto reusex::geometry::segment_planes_impl | ( | CloudConstPtr | cloud, |
| CloudNConstPtr | normals, | ||
| const SegmentPlanesOptions & | options ) -> std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr > |
| auto reusex::geometry::segment_rooms | ( | CloudConstPtr | cloud, |
| CloudNConstPtr | normals, | ||
| CloudLConstPtr | planes, | ||
| const SegmentRoomsOptions & | options = SegmentRoomsOptions{} ) -> CloudLPtr |
| auto reusex::geometry::segment_rooms_impl | ( | CloudConstPtr | cloud, |
| CloudNConstPtr | normals, | ||
| CloudLConstPtr | planes, | ||
| const SegmentRoomsOptions & | options ) -> CloudLPtr |
| auto reusex::geometry::separate_planes | ( | const EigenVectorContainer< double, 4 > & | planes, |
| const Eigen::Vector3d & | up = Eigen::Vector3d(0, 0, 1), | ||
| const double | epsilon = 0.1 ) -> std::tuple< std::vector< size_t >, std::vector< size_t > > |
Separate planes into horizontal and vertical based on up vector.
| planes | Plane coefficients. |
| up | Reference up vector. Default (0, 0, 1). |
| epsilon | Angular epsilon for classification. Default 0.1. |
| pcl::TextureMesh::Ptr reusex::geometry::texture_mesh | ( | pcl::PolygonMesh::Ptr | mesh, |
| std::map< int, CameraData > const & | cameras ) |
| pcl::TextureMesh::Ptr reusex::geometry::texture_mesh | ( | pcl::PolygonMesh::Ptr | mesh, |
| std::map< int, rtabmap::Transform > const & | poses, | ||
| std::map< int, rtabmap::Signature > const & | nodes ) |
Texture mesh using RTABMap signatures (legacy API).
References mesh().
| pcl::TextureMesh::Ptr reusex::geometry::texture_mesh_with_cloud | ( | pcl::PolygonMesh::Ptr | mesh, |
| CloudConstPtr | cloud ) |
References mesh().
| std::string_view reusex::geometry::to_string | ( | ComponentType | type | ) |
| pcl::PolygonMeshPtr reusex::geometry::unweld_mesh | ( | const pcl::PolygonMesh & | mesh, |
| float | threshold_radians ) |
Unweld (split) mesh vertices along sharp edges.
Vertices shared by faces whose normals differ by more than threshold_radians are duplicated so each smooth face group gets its own copy. This produces correct per-face normals for export to formats like OBJ, Speckle, or Rhino.
| mesh | Input polygon mesh (const ref, not modified). |
| threshold_radians | Maximum dihedral angle (in radians) between face normals for vertices to remain shared. 0 = fully unweld, pi = preserve all sharing. |
References mesh().