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

start colmap export #131

Merged
merged 24 commits into from
Apr 4, 2021
Merged

start colmap export #131

merged 24 commits into from
Apr 4, 2021

Conversation

johnwlambert
Copy link
Collaborator

@johnwlambert johnwlambert commented Mar 31, 2021

Dump
images.txt
cameras.txt
points3D.txt

per the COLMAP file specification

Screen Shot 2021-04-02 at 12 11 10 PM

Screen Shot 2021-04-02 at 12 11 06 PM

Screen Shot 2021-04-02 at 12 11 03 PM

file_path = os.path.join(save_dir, "images.txt")
with open(file_path, "w") as f:
f.write("# Number of cameras: {}\n".format(gtsfm_data.number_images()))
f.write("# Image list with two lines of data per image:")
f.write("# IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME")
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically, camera ID and image ID can be different. How will we handle that? Maybe we need the camera-id image-id map in our pipeline too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think that is a more conceptual change that will require some re-thinking. I added it to an issue #130

Comment on lines +206 to +207
# TODO: assign unique indices to all keypoints (2d points)
point2d_idx = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

These indices will be 0-n per image, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so.

POINT2D_IDX defines the zero-based index of the keypoint in the images.txt file

https://colmap.github.io/format.html#points3d-txt

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, maybe you are right. It's a bit unclear.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we should do a test run with COLMAP to check that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@adisingh50 would you mind looking into this issue here about what the 2d keypoint/point index means?

gtsfm/utils/io.py Outdated Show resolved Hide resolved
@adisingh50
Copy link
Collaborator

Thanks for adding all this. Once this PR is merged into master, the point clouds we render will look much cooler now that we can render colors and camera poses.

gtsfm/utils/images.py Outdated Show resolved Hide resolved
gtsfm/utils/images.py Outdated Show resolved Hide resolved
gtsfm/scene_optimizer.py Outdated Show resolved Hide resolved
gtsfm/scene_optimizer.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ayushbaid ayushbaid left a comment

Choose a reason for hiding this comment

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

Some minor comments

@johnwlambert johnwlambert merged commit 6934b63 into master Apr 4, 2021
@johnwlambert johnwlambert deleted the start-colmap-export branch April 4, 2021 04:51
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