32#include <Eigen/Geometry>
54 Eigen::Matrix4d
T_ij = Eigen::Matrix4d::Identity();
244 const std::vector<Eigen::Matrix4d> &seed_poses,
298 const std::vector<int> &node_ids,
323 const std::vector<Eigen::Matrix4d> &seed,
340 const Eigen::Matrix3Xd &dst,
342 Eigen::Matrix4d &best_T);
350 const std::vector<Eigen::Matrix4d> &seed,
Internals of detect_loop_edges, exposed ONLY so the geometry stages of the pipeline can be regression...
std::vector< LoopEdge > pcm_filter(std::vector< LoopEdge > edges, const std::vector< Eigen::Matrix4d > &seed, const LoopClosureOptions &opt)
Pairwise Consistency Maximization (Mangelson et al.
std::vector< int > ransac_rigid(const Eigen::Matrix3Xd &src, const Eigen::Matrix3Xd &dst, const LoopClosureOptions &opt, std::mt19937 &rng, Eigen::Matrix4d &best_T)
RANSAC 3D-3D rigid fit: estimate best_T with dst ~= best_T * src from putative correspondences (both ...
LoopProposal
How loop-candidate frame pairs are proposed before geometric verification.
@ automatic
Pick automatically (default): exhaustive when the temporally-distant pair count is within exhaustive_...
@ exhaustive
Every temporally distant pair (i, j) with j - i >= min_frame_gap.
@ appearance
Appearance shortlist from a pose-INDEPENDENT bag-of-words over the frames' own ORB descriptors.
@ spatial
Spatial shortlist from the SEED poses (camera-centre proximity + view agreement).
double trajectory_extent(const std::vector< Eigen::Matrix4d > &poses)
Spatial extent of a trajectory: the diagonal of the axis-aligned bounding box of the camera centres,...
double seed_disagreement_gate(double extent, double fraction, double floor_m)
Effective seed-disagreement gate in metres, combining a scale-relative term with an absolute floor: m...
std::vector< LoopEdge > load_loop_edges(const std::string &path, const std::vector< int > &node_ids, LoopClosureResult *out_result=nullptr)
Load externally-computed loop edges from a JSON file and map them onto the optimizer's frame indices.
std::vector< LoopEdge > detect_loop_edges(ProjectDB &db, const std::vector< int > &node_ids, const std::vector< Eigen::Matrix4d > &seed_poses, const LoopClosureOptions &options, LoopClosureResult *out_result=nullptr)
Detect wide-baseline loop edges among the given frames.
std::vector< LoopEdge > filter_consistent_loop_edges(std::vector< LoopEdge > edges, const std::vector< Eigen::Matrix4d > &seed, const LoopClosureOptions &options)
Keep only the largest mutually consistent subset of edges (Pairwise Consistency Maximization,...
Parameters for wide-baseline loop-edge detection.
float pcm_trans_threshold
cycle translation tolerance (m)
float ransac_inlier_dist
3D-3D inlier threshold (m)
float min_depth
ignore keypoints with depth outside
unsigned seed
RANSAC determinism.
float max_depth
[min_depth, max_depth] (m)
int min_frame_gap
Skip pairs closer than this in frame index (those are handled by the temporal odometry factors,...
int exhaustive_budget
automatic uses exhaustive proposal when the temporally-distant pair count is at most this; above it,...
float min_seed_disagreement_fraction
Scale-relative part of the lower gate: a fraction of the seed trajectory's extent (issue #339).
LoopProposal proposal
Candidate-proposal strategy (see LoopProposal). Default automatic.
float max_candidate_distance
Propose a pair only if the seed camera centres are within this distance.
float min_sigma_trans
floor on the translational std (m)
float min_seed_disagreement
LOWER gate: keep a loop edge only if its relative translation disagrees with the seed poses by at lea...
bool pcm
Keep only the largest MUTUALLY CONSISTENT set of loop edges (Mangelson et al., PCM).
float base_sigma_trans
Base translational/rotational std at min_match_inliers; both shrink as sqrt(min_match_inliers/inliers...
float min_sigma_rot
floor on the rotational std (rad)
int pcm_max_edges
Cap the edge set fed to the O(M^2) consistency test (keep the highest- inlier edges).
float pcm_rot_threshold
cycle rotation tolerance (rad, ~8.6 deg)
int vocab_sample_per_frame
descriptors sampled per frame for vocab
int ransac_iterations
RANSAC hypotheses.
int vocab_iterations
k-means (k-majority) refinement passes
int max_candidates_per_frame
Keep at most this many candidates per frame (nearest / most-similar first).
int vocab_size
visual words (binary k-means clusters)
float max_view_angle
…and their optical viewing directions agree within this angle.
int max_features
ORB features per frame.
float ratio_test
Lowe ratio threshold for descriptor match.
float max_seed_disagreement
Optional sanity gate: reject an edge whose relative translation disagrees with the seed poses by more...
int min_match_inliers
reject a pair below this many RANSAC inliers
bool enable
off by default; opt-in via rux optimize --loop-closure
Summary statistics from loop-edge detection.
int candidates
spatially proposed pairs that were matched
int total_inliers
summed RANSAC inliers across accepted edges
int edges
accepted loop edges
A metric relative-pose constraint between two frames, ready to become a gtsam::BetweenFactor<Pose3>.
Eigen::Matrix4d T_ij
relative pose pose(i)^-1 * pose(j)
int inliers
RANSAC inlier correspondences supporting it.
int j
second frame (index into the frames vector)
double sigma_trans
translational std of the edge (m)
double sigma_rot
rotational std of the edge (rad)
int i
first frame (index into the frames vector)