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

How to properly load COLMAP information #3

Closed
VitorGuizilini-TRI opened this issue Jul 27, 2024 · 4 comments
Closed

How to properly load COLMAP information #3

VitorGuizilini-TRI opened this issue Jul 27, 2024 · 4 comments

Comments

@VitorGuizilini-TRI
Copy link

Hi, first of all, thank you for the great dataset!

I am trying to extract COLMAP information from the reconstruct folder, however when I try opening the images.bin file I get this error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 0: unexpected end of data

So, I was wondering if there is an "official" way to extract this information for the MegaScenes dataset specifically.

Thank you!

@jot-jt
Copy link
Contributor

jot-jt commented Jul 27, 2024

Hi! We recommend importing this module to read the binary files: https://github.com/colmap/colmap/blob/main/scripts/python/read_write_model.py.

Specifically, the helpful functions are read_images_binary(images_bin_path), read_cameras_binary(cameras_bin_path), and read_points3D_binary(points3D_bin_path). Each function returns a named tuple that can be manipulated in Python.

@VitorGuizilini-TRI
Copy link
Author

Thanks! I'm using this module already, and here is where it's crashing:
https://github.com/colmap/colmap/blob/a2db4b6f91a68e17a0894dc959698c1650fb236f/scripts/python/read_write_model.py#L266

@jot-jt
Copy link
Contributor

jot-jt commented Jul 27, 2024

Is it possible that you are using an older version of this script? Previously, we also got the same error at the while loop when reading images.bin. We updated the script in this pull request to fix this issue: colmap/colmap#2344

If the updated script does not work, can you let us know which images.bin file cannot be read, so we can try to reproduce the error? Thanks!

@VitorGuizilini-TRI
Copy link
Author

Great, seems to be fixed now! Thank you!

@jot-jt jot-jt closed this as completed Jul 27, 2024
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

No branches or pull requests

2 participants