nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
9.55k stars 1.3k forks source link

Colmap preprocess data resulting in low pose matches due to global bundle adjust tolerance #2988

Open dlazares opened 8 months ago

dlazares commented 8 months ago

Running nerfstudio v1.0.2 colmap (v3.10) preprocess data on a dataset I know gives good colmap matches. I was surprised to see less than 5% matches so I investigated deeper. It seems that multiple models are created sparse/0 and sparse/1 with the first only having a handful of the images and the second model having all of them. I thought that was strange so I re-ran the commands in run_colmap by hand. I found that running with --Mapper.ba_global_function_tolerance=1e-6 created the two models whereas running without created a single model under sparse/0. I originally ran this on colmap 3.10 but also tested it on colmap 3.9.1. image

KevinOPG commented 8 months ago

This happens to me a lot as well, would changing the tolerance back to default(0) in colmap_utils.py fix this?

KevinOPG commented 8 months ago

right now I just manully go through the colmap folder in the output to see which model is the largest and use the colmap_to_json script to make the transfrom.json.

from nerfstudio.process_data import colmap_utils
from pathlib import Path
colmap_utils.colmap_to_json(recon_dir=Path("path to the camera and image.bin"), output_dir=Path("path to sparse_pc.ply"))
AidanNelson commented 5 months ago

@KevinOPG that solution worked for me. Thanks!