ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
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
16
namespace
reusex::geometry
{
17
19
struct
CameraData
{
20
cv::Mat
image
;
21
core::SensorIntrinsics
intrinsics
;
22
Eigen::Matrix4d
pose
;
23
};
24
26
struct
TextureQualityParams
{
27
float
texels_per_meter
= 400.0f;
29
int
min_resolution
= 256;
30
int
max_resolution
= 4096;
31
int
atlas_tile_size
=
32
2048;
33
float
distance_threshold
= 0.02f;
35
float
search_radius
= 0.04f;
36
int
max_neighbors
= 100;
37
bool
use_quadratic_falloff
=
38
true
;
39
};
40
41
pcl::TextureMesh::Ptr
texture_mesh_with_cloud
(
42
pcl::PolygonMesh::Ptr
mesh
,
CloudConstPtr
cloud,
43
CloudNConstPtr
normals =
nullptr
,
bool
debug_distinct_colors =
false
,
44
const
TextureQualityParams
&quality =
TextureQualityParams
());
45
47
pcl::TextureMesh::Ptr
48
texture_mesh
(pcl::PolygonMesh::Ptr
mesh
,
49
std::map<int, rtabmap::Transform>
const
&poses,
50
std::map<int, rtabmap::Signature>
const
&nodes);
51
53
pcl::TextureMesh::Ptr
texture_mesh
(pcl::PolygonMesh::Ptr
mesh
,
54
std::map<int, CameraData>
const
&cameras);
55
}
// namespace reusex::geometry
reusex::geometry
Definition
processing_observer.hpp:19
reusex::geometry::mesh
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.
reusex::geometry::texture_mesh_with_cloud
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())
reusex::geometry::texture_mesh
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).
reusex::CloudConstPtr
typename Cloud::ConstPtr CloudConstPtr
Definition
types.hpp:28
reusex::CloudNConstPtr
typename CloudN::ConstPtr CloudNConstPtr
Definition
types.hpp:32
reusex::core::SensorIntrinsics
Lightweight camera intrinsics replacing rtabmap::CameraModel in downstream code.
Definition
SensorIntrinsics.hpp:14
reusex::geometry::CameraData
Camera data for texture mapping.
Definition
texture_mesh.hpp:19
reusex::geometry::CameraData::intrinsics
core::SensorIntrinsics intrinsics
Camera intrinsics.
Definition
texture_mesh.hpp:21
reusex::geometry::CameraData::pose
Eigen::Matrix4d pose
World pose (SE(3)).
Definition
texture_mesh.hpp:22
reusex::geometry::CameraData::image
cv::Mat image
Color image.
Definition
texture_mesh.hpp:20
reusex::geometry::TextureQualityParams
Quality parameters for texture projection.
Definition
texture_mesh.hpp:26
reusex::geometry::TextureQualityParams::max_resolution
int max_resolution
Maximum texture size (large surfaces).
Definition
texture_mesh.hpp:30
reusex::geometry::TextureQualityParams::distance_threshold
float distance_threshold
Max distance from point to surface (meters) - smaller = sharper.
Definition
texture_mesh.hpp:33
reusex::geometry::TextureQualityParams::atlas_tile_size
int atlas_tile_size
Atlas tile size for PCL visualization (lower = less memory).
Definition
texture_mesh.hpp:31
reusex::geometry::TextureQualityParams::use_quadratic_falloff
bool use_quadratic_falloff
Use 1/d^2 instead of 1/d for sharper detail.
Definition
texture_mesh.hpp:37
reusex::geometry::TextureQualityParams::min_resolution
int min_resolution
Minimum texture size (small surfaces).
Definition
texture_mesh.hpp:29
reusex::geometry::TextureQualityParams::max_neighbors
int max_neighbors
Max points to check per pixel.
Definition
texture_mesh.hpp:36
reusex::geometry::TextureQualityParams::search_radius
float search_radius
K-d tree search radius (meters).
Definition
texture_mesh.hpp:35
reusex::geometry::TextureQualityParams::texels_per_meter
float texels_per_meter
Target texture detail (pixels per meter).
Definition
texture_mesh.hpp:27
libs
reusex
include
geometry
texture_mesh.hpp
Generated by
1.17.0