ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
texture_mesh.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6#include "reusex/core/SensorIntrinsics.hpp"
7#include "reusex/types.hpp"
8
9#include <opencv2/core/mat.hpp>
10#include <pcl/PolygonMesh.h>
11#include <pcl/TextureMesh.h>
12#include <rtabmap/core/DBDriver.h>
13
14#include <map>
15
16namespace reusex::geometry {
17
19struct CameraData {
20 cv::Mat image;
22 Eigen::Matrix4d pose;
23};
24
27 float texels_per_meter = 400.0f;
29 int min_resolution = 256;
30 int max_resolution = 4096;
32 2048;
33 float distance_threshold = 0.02f;
35 float search_radius = 0.04f;
36 int max_neighbors = 100;
38 true;
39};
40
41pcl::TextureMesh::Ptr texture_mesh_with_cloud(
42 pcl::PolygonMesh::Ptr mesh, CloudConstPtr cloud,
43 CloudNConstPtr normals = nullptr, bool debug_distinct_colors = false,
45
47pcl::TextureMesh::Ptr
48texture_mesh(pcl::PolygonMesh::Ptr mesh,
49 std::map<int, rtabmap::Transform> const &poses,
50 std::map<int, rtabmap::Signature> const &nodes);
51
53pcl::TextureMesh::Ptr texture_mesh(pcl::PolygonMesh::Ptr mesh,
54 std::map<int, CameraData> const &cameras);
55} // namespace reusex::geometry
pcl::PolygonMeshPtr 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.
pcl::TextureMesh::Ptr texture_mesh_with_cloud(pcl::PolygonMesh::Ptr mesh, CloudConstPtr cloud, CloudNConstPtr normals=nullptr, bool debug_distinct_colors=false, const TextureQualityParams &quality=TextureQualityParams())
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).
typename Cloud::ConstPtr CloudConstPtr
Definition types.hpp:28
typename CloudN::ConstPtr CloudNConstPtr
Definition types.hpp:32
Lightweight camera intrinsics replacing rtabmap::CameraModel in downstream code.
Camera data for texture mapping.
core::SensorIntrinsics intrinsics
Camera intrinsics.
Eigen::Matrix4d pose
World pose (SE(3)).
cv::Mat image
Color image.
Quality parameters for texture projection.
int max_resolution
Maximum texture size (large surfaces).
float distance_threshold
Max distance from point to surface (meters) - smaller = sharper.
int atlas_tile_size
Atlas tile size for PCL visualization (lower = less memory).
bool use_quadratic_falloff
Use 1/d^2 instead of 1/d for sharper detail.
int min_resolution
Minimum texture size (small surfaces).
int max_neighbors
Max points to check per pixel.
float search_radius
K-d tree search radius (meters).
float texels_per_meter
Target texture detail (pixels per meter).