Skip to content

Unify BA options OR expose solver thresholds during incremental_mapping #4446

Closed

Description

@Dawars

I'd like to set the solver type thresholds for incremental_mapping (e.g. max_num_images_direct_sparse_gpu_solver) without rebuilding the codebase depending on the problem configuration (rigs, fixed intrinsics, etc).

If I understand correctly, currently incremental mapper has duplicate/exposed some ceres specific BA params that are later set in global/local BA for BundleAdjustmentOptions.ceres.
These are: ba_local_function_tolerance, ba_local_max_num_iterations for local and ba_global_function_tolerance, ba_global_max_num_iterations, num_threads, ba_min_num_residuals_for_cpu_multi_threading, ba_use_gpu, ba_gpu_index for global BA.

The rest of the ceres options are not exposed, BundleAdjustmentOptions.ceres cannot be directly set.

if (options.ceres) {
options.ceres->solver_options.function_tolerance =
ba_local_function_tolerance;
options.ceres->solver_options.gradient_tolerance = 10.0;
options.ceres->solver_options.parameter_tolerance = 0.0;
options.ceres->solver_options.max_num_iterations =
ba_local_max_num_iterations;
options.ceres->solver_options.max_linear_solver_iterations = 100;
options.ceres->solver_options.logging_type = ceres::LoggingType::SILENT;
options.ceres->solver_options.num_threads = num_threads;
#if CERES_VERSION_MAJOR < 2
options.ceres->solver_options.num_linear_solver_threads = num_threads;
#endif // CERES_VERSION_MAJOR
options.ceres->min_num_residuals_for_cpu_multi_threading =
ba_min_num_residuals_for_cpu_multi_threading;
options.ceres->loss_function_scale = 1.0;
options.ceres->loss_function_type =
CeresBundleAdjustmentOptions::LossFunctionType::SOFT_L1;
options.ceres->use_gpu = ba_use_gpu;
options.ceres->gpu_index = ba_gpu_index;
}

IMO it would be a good option if we could edit the settings returned by IncrementalPipelineOptions.get_local_bundle_adjustment, currently it is returning a copy. https://colmap.github.io/pycolmap/pycolmap.html#pycolmap.IncrementalPipelineOptions.get_local_bundle_adjustment

Is there another way to set these at runtime?

Activity

  1. added a commit that references this issue on Oct 28, 2026
    f00d606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions