Skip to content

Add relative poses to DatabaseCache and update the signature of global mapper. #3960

Merged
B1ueber2y merged 12 commits into
mainfrom
shaohui/use_database_cache_in_global
Jan 7, 2026
Merged

Add relative poses to DatabaseCache and update the signature of global mapper. #3960
B1ueber2y merged 12 commits into
mainfrom
shaohui/use_database_cache_in_global

Conversation

@B1ueber2y

@B1ueber2y B1ueber2y commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Breaking change: Now the static methods of DatabaseCache, including Create, CreateFromCache, and Load, take a DatabaseCache::Options object rather than scattered arguments.

Replace database_ member with database_cache_ throughout the global mapper logic except for GlobalPipeline, which requires view graph calibrator to live outside the pipeline logic.

@B1ueber2y B1ueber2y requested a review from ahojnnes January 6, 2026 19:58

@ahojnnes ahojnnes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/colmap/scene/database_cache.cc Outdated
const bool ignore_watermarks,
const std::unordered_set<std::string>& image_names) {
const std::unordered_set<std::string>& image_names,
const bool load_relative_pose) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe it's now time to introduce options class DatabaseCache { struct Options { ... }; };

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice idea. This is done. To align the pybind interfaces with C++, we would have to introduce breaking changes there. Updated the PR description.

Comment thread src/colmap/scene/database_cache.h Outdated
@B1ueber2y B1ueber2y added the breaking Indicates a breaking change. label Jan 7, 2026
@B1ueber2y B1ueber2y requested a review from ahojnnes January 7, 2026 18:42
@B1ueber2y B1ueber2y merged commit 7b47036 into main Jan 7, 2026
14 checks passed
@B1ueber2y B1ueber2y deleted the shaohui/use_database_cache_in_global branch January 7, 2026 20:32
@B1ueber2y

Copy link
Copy Markdown
Contributor Author

The regression issues actually happened here. If every camera is calibrated, the view graph calibration will directly return true without re-estimating relative poses, leaving all cam2_from_cam1 empty. Will send in a fix.

B1ueber2y added a commit that referenced this pull request Jan 8, 2026
…e. (#3966)

Fix regression issues from #3960.
This was due to the fact that relative pose re-estimation only works on
pairs that are newly calibrated. So if every camera is calibrated, the
relative pose wont be decomposed without this fix.

This actually reveals another inconsistency from
#3943. If it is the calibrated
case, the original code will just skip relative pose re-estimation so
that the default colmap two-view geometry is respected, rather than the
one in the re-estimation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Indicates a breaking change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants