From cfce2ad4aa0b7dc384e1a5757c9d8ed430e0b1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 25 Jan 2025 11:25:57 +0100 Subject: [PATCH] Expose incremental mapper pose prior options in pycolmap --- src/colmap/controllers/incremental_pipeline.h | 8 ++++---- src/pycolmap/sfm/incremental_mapper.cc | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/colmap/controllers/incremental_pipeline.h b/src/colmap/controllers/incremental_pipeline.h index 70118ddbb0..a7aa9e8872 100644 --- a/src/colmap/controllers/incremental_pipeline.h +++ b/src/colmap/controllers/incremental_pipeline.h @@ -119,14 +119,14 @@ struct IncrementalPipelineOptions { bool ba_use_gpu = false; std::string ba_gpu_index = "-1"; - // Whether to use prior camera positions + // Whether to use priors on the camera positions. bool use_prior_position = false; - // Whether to use a robust loss on prior locations + // Whether to use a robust loss on prior camera positions. bool use_robust_loss_on_prior_position = false; - // Threshold on the residual for the robust loss - // (chi2 for 3DOF at 95% = 7.815) + // Threshold on the residual for the robust position prior loss + // (chi2 for 3DOF at 95% = 7.815). double prior_position_loss_scale = 7.815; // Path to a folder with reconstruction snapshots during incremental diff --git a/src/pycolmap/sfm/incremental_mapper.cc b/src/pycolmap/sfm/incremental_mapper.cc index b3a1a1648c..6951e91ae7 100644 --- a/src/pycolmap/sfm/incremental_mapper.cc +++ b/src/pycolmap/sfm/incremental_mapper.cc @@ -142,6 +142,16 @@ void BindIncrementalPipeline(py::module& m) { "ba_global_max_refinement_change", &Opts::ba_global_max_refinement_change, "The thresholds for iterative bundle adjustment refinements.") + .def_readwrite("use_prior_position", + &Opts::use_prior_position, + "Whether to use priors on the camera positions.") + .def_readwrite("use_robust_loss_on_prior_position", + &Opts::use_robust_loss_on_prior_position, + "Whether to use a robust loss on prior camera positions.") + .def_readwrite("prior_position_loss_scale", + &Opts::prior_position_loss_scale, + "Threshold on the residual for the robust position prior " + "loss (chi2 for 3DOF at 95% = 7.815).") .def_readwrite("snapshot_path", &Opts::snapshot_path, "Path to a folder in which reconstruction snapshots will "