YoYo000 / MVSNet

MVSNet (ECCV2018) & R-MVSNet (CVPR2019)
MIT License
1.41k stars 304 forks source link

Potential Bug in colmap2mvsnet.py #121

Closed hamzarawal closed 3 years ago

hamzarawal commented 3 years ago

Hi, thanks for the good work. I was using the colmap2mvsnet script for converting COLMAP output. The script assumes that COLMAP assigns image_ids and camera_ids in the same order as images are arranged in a folder. However that is not always the case and thus the script saves poses in incorrect order.

https://github.com/YoYo000/MVSNet/blob/4c4aa5e2336a214e4bde2de31c9a46f55a8150c5/mvsnet/colmap2mvsnet.py#L415

Changing the line as follows makes the script work:

-with open(os.path.join(cam_dir, '%08d_cam.txt' % i), 'w') as f:
+with open(os.path.join(cam_dir, '%s_cam.txt' % images[i+1].name[:-4]), 'w') as f:

It will be good if the file is updated in main repository. Thanks :)

YoYo000 commented 3 years ago

Thanks @hamzarawal ! I will try to fix the script soon