ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
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
14namespace reusex {
15class ProjectDB;
16}
17
18namespace reusex::slam {
19
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
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
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
66 int to_id,
67 const FramePairIcpOptions &opts = {});
68
69} // namespace reusex::slam
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...
Knobs of refine_frame_pair_icp().
int max_iterations
STANDARDS ยง6: a deterministic bound.
int pixel_step
sample every Nth depth pixel
float min_depth_m
drop closer returns
float inlier_threshold_m
gate for inlier_fraction
double max_correspondence_m
initial correspondence window
float max_depth_m
drop farther returns
double fitness
RMS correspondence error after ICP (m).
double rotation_deg
Rotation angle of world_delta (degrees).
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...
double source_center_shift_m
How far the correction moves the "from" camera's optical centre (m): |delta * c - c|.
double inlier_fraction
share of "from" points within the gate
int target_points
back-projected points of the "to" frame
int source_points
back-projected points of the "from" frame
std::array< double, 16 > world_delta
The ICP correction applied to the "from" cloud in world space (identity when the stored poses already...