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

Skip to content

Conversation

@StonerLing
Copy link
Contributor

This PR introduces a random_seed option in IncrementalMapper that controls the random seeds used in all RANSAC processes throughout the reconstruction pipeline. This enhancement improves SfM reproducibility, facilitating debugging and consistent testing.

Floating-point variations from Ceres optimization in multithreaded environments remain unavoidable.

options.AddDefaultOption("gpu_index", &reconstruction_options.gpu_index);
options.Parse(argc, argv);

reconstruction_options.random_seed = kDefaultPRNGSeed;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a random_seed field to AutomaticReconstructionController::Options and appropriately passing it inside the AutomaticReconstructionController to the respective workers? Then, here we would expose it also as a commandline argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. To avoid naming conflicts, I renamed the global random_seed in OptionsManager to default_random_seed.


ASSERT_EQ(reconstruction_manager0->Size(), 1);

// Same seed should produce similar results, up to floating-point variations
Copy link
Contributor

Choose a reason for hiding this comment

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

If we set num_threads=1, the reconstructions should be identical?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I added single-threaded tests. Using the same seed and single thread produces identical results.

@ahojnnes ahojnnes enabled auto-merge (squash) August 8, 2025 11:29
@ahojnnes ahojnnes merged commit cd3bccd into colmap:main Aug 8, 2025
14 checks passed
@StonerLing StonerLing deleted the feature/mapper-random-seed branch August 8, 2025 12:15
tavislocus pushed a commit to tavislocus/colmap_6dof that referenced this pull request Aug 19, 2025
…improved SfM reproducibility (colmap#3544)

This PR introduces a `random_seed` option in IncrementalMapper that
controls the random seeds used in all RANSAC processes throughout the
reconstruction pipeline. This enhancement improves SfM reproducibility,
facilitating debugging and consistent testing.

Floating-point variations from Ceres optimization in multithreaded
environments remain unavoidable.

---------

Co-authored-by: StonerLing <[email protected]>
Co-authored-by: Johannes Schönberger <[email protected]>
tavislocus pushed a commit to tavislocus/colmap_6dof that referenced this pull request Aug 22, 2025
…improved SfM reproducibility (colmap#3544)

This PR introduces a `random_seed` option in IncrementalMapper that
controls the random seeds used in all RANSAC processes throughout the
reconstruction pipeline. This enhancement improves SfM reproducibility,
facilitating debugging and consistent testing.

Floating-point variations from Ceres optimization in multithreaded
environments remain unavoidable.

---------

Co-authored-by: StonerLing <[email protected]>
Co-authored-by: Johannes Schönberger <[email protected]>
tavislocus pushed a commit to tavislocus/colmap_6dof that referenced this pull request Aug 22, 2025
…improved SfM reproducibility (colmap#3544)

This PR introduces a `random_seed` option in IncrementalMapper that
controls the random seeds used in all RANSAC processes throughout the
reconstruction pipeline. This enhancement improves SfM reproducibility,
facilitating debugging and consistent testing.

Floating-point variations from Ceres optimization in multithreaded
environments remain unavoidable.

---------

Co-authored-by: StonerLing <[email protected]>
Co-authored-by: Johannes Schönberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants