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

Skip to content

Conversation

@B1ueber2y
Copy link
Contributor

No description provided.

@B1ueber2y B1ueber2y enabled auto-merge (squash) September 15, 2025 14:53
Copy link
Member

@sarlinpe sarlinpe left a comment

Choose a reason for hiding this comment

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

Thank you!

@sarlinpe sarlinpe disabled auto-merge September 15, 2025 15:13
@B1ueber2y B1ueber2y changed the title Add missing write_rig and write_frame interfaces for pycolmap database. Add missing rig and frame interfaces for pycolmap database. Sep 15, 2025
Copy link
Contributor

@ahojnnes ahojnnes left a comment

Choose a reason for hiding this comment

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

Thanks, the reordering of the methods is a bit unrelated to the actual change. I don't have super strong opinions but I actually ordered it intentionally as rigs before cameras to be consistent with frames before images. What's the rationale for swapping cameras and rigs?

@B1ueber2y
Copy link
Contributor Author

Thanks, the reordering of the methods is a bit unrelated to the actual change. I don't have super strong opinions but I actually ordered it intentionally as rigs before cameras to be consistent with frames before images. What's the rationale for swapping cameras and rigs?

This aligns with the ordering of initialization, as in here: https://github.com/colmap/colmap/blob/main/src/colmap/scene/reconstruction.cc#L134. This was because we wanted to check whether each camera in the rig exists in the reconstruction: #3564

@B1ueber2y
Copy link
Contributor Author

Thanks, the reordering of the methods is a bit unrelated to the actual change. I don't have super strong opinions but I actually ordered it intentionally as rigs before cameras to be consistent with frames before images. What's the rationale for swapping cameras and rigs?

This aligns with the ordering of initialization, as in here: https://github.com/colmap/colmap/blob/main/src/colmap/scene/reconstruction.cc#L134. This was because we wanted to check whether each camera in the rig exists in the reconstruction: #3564

Alternatively, we can also keep the previous order but add a rig ptr inside the camera class, and reorder initialization back to rigs -> cameras -> frames -> images, to be consistent with the frames and images.

This will however, lose the possibility to check whether each camera in the rig exists in the reconstruction, similar to the issue that we cannot check whether each image in the frame exists in the reconstruction, as frames must be inserted before images due to the presence of frame ptr in the images. After all we can only check one direction because we support independent AddCamera and AddImage regardless of rigs and frames.

@ahojnnes
Copy link
Contributor

Thanks for the explanation. I don't think it matters too much and I am also fine with changing it to your proposal, if you feel strongly about it. My reasoning for the ordering was to first list rigs and then all its sensors (with cameras just being one of them and more to be added later). Equivalently, first list frames and then all its data (with images just being one of them and more to be added later).

@B1ueber2y
Copy link
Contributor Author

Thanks for the explanation. I don't think it matters too much and I am also fine with changing it to your proposal, if you feel strongly about it. My reasoning for the ordering was to first list rigs and then all its sensors (with cameras just being one of them and more to be added later). Equivalently, first list frames and then all its data (with images just being one of them and more to be added later).

Thanks. The reasoning you mentioned also makes sense to me. I agree that in the end it does not matter much. Feel free to ask if we want to revert the ordering before merging (I can do it quickly). Otherwise I think we could move forward, as it is blocking the downstream hloc fix : )

@ahojnnes
Copy link
Contributor

If it's not a big issue, I suggest containing this PR to the changes in the title and undo the reordering.

@B1ueber2y
Copy link
Contributor Author

If it's not a big issue, I suggest containing this PR to the changes in the title and undo the reordering.

Done. Thanks!

@B1ueber2y B1ueber2y enabled auto-merge (squash) September 16, 2025 08:56
@ahojnnes
Copy link
Contributor

Thank you.

@B1ueber2y B1ueber2y merged commit 11db388 into colmap:main Sep 16, 2025
13 checks passed
@B1ueber2y B1ueber2y deleted the fix/pycolmap_database branch September 16, 2025 09:29
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.

3 participants