Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sfm : Refining center instead of translation#2124

Open
servantftransperfect wants to merge 1 commit into
developfrom
dev/bundleCenter
Open

sfm : Refining center instead of translation#2124
servantftransperfect wants to merge 1 commit into
developfrom
dev/bundleCenter

Conversation

@servantftransperfect
Copy link
Copy Markdown
Contributor

@servantftransperfect servantftransperfect commented May 6, 2026

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_TRANSLATION with REFINE_CENTER across 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 as R * (X - C).
  • Adjusted pose update paths (CameraPose, rig sub-poses) to write back refined centers correctly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TRANSLATION with REFINE_CENTER across 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 as R * (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.

Comment thread src/aliceVision/sfm/bundle/BundleAdjustment.hpp Outdated
Comment thread src/aliceVision/sfm/bundle/costfunctions/projectionMesh.hpp
Comment thread src/aliceVision/sfm/bundle/BundleAdjustmentCeres.cpp Outdated
Comment thread src/aliceVision/sfm/bundle/costfunctions/projection.hpp
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants