ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
frame_pair_icp.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 Povl Filip Sonne-Frederiksen
2
//
3
// SPDX-License-Identifier: GPL-3.0-or-later
4
5
#pragma once
6
7
// Depth-cloud ICP between two stored sensor frames (#465): the "refine" of a
8
// pose-graph link. Both the web GUI's POST /api/v1/posegraph/icp (through the
9
// app's IcpRefineFn) and the Qt client's pair strip call this, so the two
10
// surfaces report the same numbers for the same pair.
11
12
#include <array>
13
14
namespace
reusex
{
15
class
ProjectDB
;
16
}
17
18
namespace
reusex::slam
{
19
23
struct
FramePairIcpOptions
{
24
int
pixel_step
= 4;
25
float
min_depth_m
= 0.3f;
26
float
max_depth_m
= 4.0f;
27
int
max_iterations
= 50;
28
double
max_correspondence_m
= 0.5;
29
float
inlier_threshold_m
= 0.05f;
30
};
31
32
struct
FramePairIcpResult
{
37
std::array<double, 16>
relative_pose
{1, 0, 0, 0, 0, 1, 0, 0,
38
0, 0, 1, 0, 0, 0, 0, 1};
39
41
std::array<double, 16>
world_delta
{1, 0, 0, 0, 0, 1, 0, 0,
42
0, 0, 1, 0, 0, 0, 0, 1};
43
47
double
source_center_shift_m
= 0.0;
49
double
rotation_deg
= 0.0;
50
double
fitness
= 0.0;
51
double
inlier_fraction
= 0.0;
52
bool
converged
=
false
;
53
int
source_points
= 0;
54
int
target_points
= 0;
55
};
56
65
FramePairIcpResult
refine_frame_pair_icp
(
const
ProjectDB
&db,
int
from_id,
66
int
to_id,
67
const
FramePairIcpOptions
&opts = {});
68
69
}
// namespace reusex::slam
reusex::ProjectDB
Definition
ProjectDB.hpp:45
reusex::slam
Definition
frame_pair_icp.hpp:18
reusex::slam::refine_frame_pair_icp
FramePairIcpResult refine_frame_pair_icp(const ProjectDB &db, int from_id, int to_id, const FramePairIcpOptions &opts={})
Back-project each frame's stored depth into world space (its stored pose and intrinsics) and run poin...
reusex
Definition
component_record.hpp:12
reusex::slam::FramePairIcpOptions
Knobs of refine_frame_pair_icp().
Definition
frame_pair_icp.hpp:23
reusex::slam::FramePairIcpOptions::max_iterations
int max_iterations
STANDARDS ยง6: a deterministic bound.
Definition
frame_pair_icp.hpp:27
reusex::slam::FramePairIcpOptions::pixel_step
int pixel_step
sample every Nth depth pixel
Definition
frame_pair_icp.hpp:24
reusex::slam::FramePairIcpOptions::min_depth_m
float min_depth_m
drop closer returns
Definition
frame_pair_icp.hpp:25
reusex::slam::FramePairIcpOptions::inlier_threshold_m
float inlier_threshold_m
gate for inlier_fraction
Definition
frame_pair_icp.hpp:29
reusex::slam::FramePairIcpOptions::max_correspondence_m
double max_correspondence_m
initial correspondence window
Definition
frame_pair_icp.hpp:28
reusex::slam::FramePairIcpOptions::max_depth_m
float max_depth_m
drop farther returns
Definition
frame_pair_icp.hpp:26
reusex::slam::FramePairIcpResult
Definition
frame_pair_icp.hpp:32
reusex::slam::FramePairIcpResult::fitness
double fitness
RMS correspondence error after ICP (m).
Definition
frame_pair_icp.hpp:50
reusex::slam::FramePairIcpResult::rotation_deg
double rotation_deg
Rotation angle of world_delta (degrees).
Definition
frame_pair_icp.hpp:49
reusex::slam::FramePairIcpResult::relative_pose
std::array< double, 16 > relative_pose
Row-major 4x4 relative pose T_to^{-1} * T_icp_delta * T_from, between the two frames' stored POSE fra...
Definition
frame_pair_icp.hpp:37
reusex::slam::FramePairIcpResult::source_center_shift_m
double source_center_shift_m
How far the correction moves the "from" camera's optical centre (m): |delta * c - c|.
Definition
frame_pair_icp.hpp:47
reusex::slam::FramePairIcpResult::inlier_fraction
double inlier_fraction
share of "from" points within the gate
Definition
frame_pair_icp.hpp:51
reusex::slam::FramePairIcpResult::target_points
int target_points
back-projected points of the "to" frame
Definition
frame_pair_icp.hpp:54
reusex::slam::FramePairIcpResult::converged
bool converged
Definition
frame_pair_icp.hpp:52
reusex::slam::FramePairIcpResult::source_points
int source_points
back-projected points of the "from" frame
Definition
frame_pair_icp.hpp:53
reusex::slam::FramePairIcpResult::world_delta
std::array< double, 16 > world_delta
The ICP correction applied to the "from" cloud in world space (identity when the stored poses already...
Definition
frame_pair_icp.hpp:41
libs
reusex
include
slam
frame_pair_icp.hpp
Generated by
1.18.0