-
Notifications
You must be signed in to change notification settings - Fork 179
fix the id error in retriangulation #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -309,7 +309,11 @@ void ConvertDatabaseToGlomap(const colmap::Database& database, | |||||||||||
| for (const auto& [camera_id, camera] : cameras) { | ||||||||||||
| if (cameras_id_to_rig_id.find(camera_id) == cameras_id_to_rig_id.end()) { | ||||||||||||
| Rig rig; | ||||||||||||
| rig.SetRigId(++max_rig_id); | ||||||||||||
| if (max_rig_id != 0) | ||||||||||||
|
||||||||||||
| if (max_rig_id != 0) | |
| // If any rigs already exist, assign a new unique rig ID by incrementing | |
| // the current maximum. Otherwise, for the very first rig, reuse the | |
| // camera_id as the rig ID to preserve original behavior. | |
| if (!rigs.empty()) |
Outdated
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID collision bug: When max_frame_id equals 0 but a frame with ID 0 exists in the database, using image_id directly can cause a collision. For example, if there's an existing frame with ID 0, and an image has image_id=0, this will create a duplicate frame ID. Consider checking frames.empty() or always incrementing from max_frame_id to avoid collisions.
Uh oh!
There was an error while loading. Please reload this page.