Skip to content
Snippets Groups Projects
Unverified Commit dc05262f authored by Ily's avatar Ily Committed by GitHub
Browse files

Update colmap2nerf.py

Add the path to a vocabulary tree when chosen "vocab_tree" as colmap_matcher
using vocabulary tree give better results https://demuc.de/colmap/
parent e4e00539
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ def parse_args():
parser.add_argument("--skip_early", default=0, help="skip this many images from the start")
parser.add_argument("--keep_colmap_coords", action="store_true", help="keep transforms.json in COLMAP's original frame of reference (this will avoid reorienting and repositioning the scene for preview and rendering)")
parser.add_argument("--out", default="transforms.json", help="output path")
parser.add_argument("--vocab_path", default="",help="vocabulary tree path")
args = parser.parse_args()
return args
......@@ -85,7 +86,12 @@ def run_colmap(args):
if os.path.exists(db):
os.remove(db)
do_system(f"colmap feature_extractor --ImageReader.camera_model {args.colmap_camera_model} --ImageReader.camera_params \"{args.colmap_camera_params}\" --SiftExtraction.estimate_affine_shape=true --SiftExtraction.domain_size_pooling=true --ImageReader.single_camera 1 --database_path {db} --image_path {images}")
do_system(f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}")
if args.colmap_matcher == "vocab_tree":
do_system(f"colmap {args.colmap_matcher}_matcher --VocabTreeMatching.vocab_tree_path {args.vocab_path} --SiftMatching.guided_matching=true --database_path {db}")
else:
do_system(f"colmap {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}")
try:
shutil.rmtree(sparse)
except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment