sfm : Refining center instead of translation#2124
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates AliceVision’s bundle adjustment to refine camera centers (C) rather than camera translations (t), aligning the optimized pose parameterization with geometry::Pose3’s center-based representation. This is intended to keep convergence behavior similar while enabling future work (e.g., covariance estimation) that benefits from center refinement.
Changes:
- Replaced
REFINE_TRANSLATIONwithREFINE_CENTERacross SfM pipelines/utilities/tests and the BA refine-options enum. - Updated BA parameter blocks and cost functions to interpret pose blocks as
[angleAxis(3), center(3)]and apply projections asR * (X - C). - Adjusted pose update paths (
CameraPose, rig sub-poses) to write back refined centers correctly.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/software/utils/main_computeUncertainty.cpp | Switches Jacobian creation refinement flags to use REFINE_CENTER. |
| src/software/pipeline/main_checkerboardCalibration.cpp | Updates calibration BA refinement flags to use REFINE_CENTER. |
| src/aliceVision/sfmData/CameraPose.hpp | Updates estimator write-back to set Pose3(R, C) instead of pose-from-(R,t). |
| src/aliceVision/sfm/pipeline/sequential/ReconstructionEngine_sequentialSfM.cpp | Uses REFINE_CENTER for sequential SfM BA. |
| src/aliceVision/sfm/pipeline/localization/SfMLocalizer.cpp | Uses REFINE_CENTER when refining a localized pose. |
| src/aliceVision/sfm/pipeline/global/ReconstructionEngine_globalSfM.cpp | Replaces translation refinement with center refinement in global SfM BA steps. |
| src/aliceVision/sfm/pipeline/global/GlobalSfMTranslationAveragingSolver.cpp | Updates debug-triplet BA call to REFINE_CENTER (but currently introduces/keeps compile issues under DEBUG_TRIPLET). |
| src/aliceVision/sfm/pipeline/expanding/SfmResection.cpp | Uses REFINE_CENTER during resection refinement BA. |
| src/aliceVision/sfm/pipeline/expanding/SfmBundle.cpp | Uses REFINE_CENTER in expanding pipeline BA configuration. |
| src/aliceVision/sfm/bundle/costfunctions/temporalConstraint.hpp | Treats pose block’s last 3 parameters as view centers directly. |
| src/aliceVision/sfm/bundle/costfunctions/survey.hpp | Updates point transform to R*(X-C) for survey residuals. |
| src/aliceVision/sfm/bundle/costfunctions/projectionMesh.hpp | Updates mesh projection to use centers, but variable naming/typos are misleading. |
| src/aliceVision/sfm/bundle/costfunctions/projection.hpp | Updates projection functors to use centers and subtract-before-rotate convention. |
| src/aliceVision/sfm/bundle/costfunctions/depth.hpp | Updates depth residual to use R*(X-C) before comparing Z. |
| src/aliceVision/sfm/bundle/BundleAdjustmentCeres.hpp | Updates pose-block comment to center-based. |
| src/aliceVision/sfm/bundle/BundleAdjustmentCeres.cpp | Fills pose blocks with centers and updates rig sub-poses via setCenter. |
| src/aliceVision/sfm/bundle/BundleAdjustment.hpp | Renames refine option to REFINE_CENTER and updates REFINE_ALL composition. |
| src/aliceVision/sfm/bundle/bundleAdjustment_temporalConstraint_test.cpp | Updates test refine flags to REFINE_CENTER. |
| src/aliceVision/sfm/bundle/bundleAdjustment_Enhanced_test.cpp | Updates pose refinement test flags to REFINE_CENTER. |
| src/aliceVision/multiview/resection/resectionLORansac_test.cpp | Updates pose refinement flags to REFINE_CENTER. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
30301eb to
0b1b174
Compare
|



This PR updates AliceVision’s bundle adjustment to refine camera centers (C) rather than camera translations (t), aligning the optimized pose parameterization with
geometry::Pose3’s center-based representation. This is intended to keep convergence behavior similar while enabling future work (e.g., covariance estimation) that benefits from center refinement.Changes:
REFINE_TRANSLATIONwithREFINE_CENTERacross SfM pipelines/utilities/tests and the BA refine-options enum.[angleAxis(3), center(3)]and apply projections asR * (X - C).CameraPose, rig sub-poses) to write back refined centers correctly.