Skip to content
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

Allow colmap parser to load 3D points #2408

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Conversation

jkulhanek
Copy link
Contributor

This PR adds an option to the colmap parser, which allows it to load 3D points. These points can be used in methods like tetra-nerf or Gaussian splatting.

Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

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

LGTM

@jkulhanek jkulhanek enabled auto-merge (squash) September 11, 2023 07:33
@jkulhanek jkulhanek merged commit ead9b37 into main Sep 11, 2023
4 checks passed
@jkulhanek jkulhanek deleted the jkulhanek/load-colmap-3D-points branch September 11, 2023 07:50
@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

Thanks @jkulhanek, very useful.

@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

@jkulhanek, can you clarify what is the meaning of "points3D_num_points"? I think the naming might be a bit misleading, if my understanding is correct.

@jkulhanek
Copy link
Contributor Author

I agree it is misleading. The meaning is the number of 2D points (number of images) the 3D point is matched to. Should I rename it to something like points3D_num_images, or do you have any other suggestions?

@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

Thanks, yes. Is there a way to also get a full list of the image IDs that have the corresponding 2d points that correspond to the 3d point in question? From what I see, this p.image_ids just gives the number of point correspondences, which in itself is kind of useful (for example getting rid of poorly corresponding points) but it would be missing the exact image ids that these correspondences can be found in. I do not have much knowledge with colmap, so I am not sure if this is a feature or not. But I think renaming to points3D_num_2d_correspondences or similar would be very clear to me at least for now.

@jkulhanek
Copy link
Contributor Author

Shouldn't p.image_ids contain the actual image IDs, not their number?

@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

I am not entirely sure, I read this page: https://colmap.github.io/format.html and they have some information about a list of image_ids and 2d point indexes for a single 3D point. Here is something similar in pycolmap: https://github.com/colmap/colmap/blob/main/scripts/python/read_write_model.py#L327. Again, I do not have much experience with colmap, so I am uncertain what this really means. Let me know if you can clarify my doubts.

@jkulhanek
Copy link
Contributor Author

I believe p.image_ids is the list of image IDs, and p.point2D_idxs is the list of 2D point IDs within the images. This would be consistent with the pycolmap code you mentioned. What made you think p.image_ids was the number of 2D matches?

@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

Thanks, the naming just has me confused :D maybe we can rename everything to be consistent with pycolmap code then.

@jkulhanek
Copy link
Contributor Author

Currently, p.image_ids is points3D_image_ids; most names are also consistent. However, this is the new points3D_num_images field, which does not have a colmap equivalent. We can name it point3D_num_point2D or points3D_num_2D_correspondences? Finally, there is points3D_image_xy which corresponds to the xys property of COLMAP's image (but indexed by the point2D_idxs): https://github.com/colmap/colmap/blob/fd84a0d8f77940568aed13c368dbfdeb837b344d/scripts/python/read_write_model.py#L255C17-L255C20
An alternative name could, therefore, be points3D_point2D_xy?

@maturk
Copy link
Collaborator

maturk commented Sep 11, 2023

I think points3D_num_points2D and points3D_points2D_xy respectively is the most clear for me. Thanks for the clarifications.

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.

None yet

3 participants