MCPcopy Create free account
hub / github.com/colmap/colmap / colmap_alignment

Function colmap_alignment

benchmark/reconstruction/evaluation/utils.py:651–681  ·  view source on GitHub ↗
(
    args: argparse.Namespace,
    sparse_path: Path,
    sparse_gt_path: Path,
    sparse_aligned_path: Path,
    max_ref_model_error: float,
)

Source from the content-addressed store, hash-verified

649
650
651def colmap_alignment(
652 args: argparse.Namespace,
653 sparse_path: Path,
654 sparse_gt_path: Path,
655 sparse_aligned_path: Path,
656 max_ref_model_error: float,
657) -> None:
658 if args.overwrite_alignment and sparse_aligned_path.exists():
659 shutil.rmtree(sparse_aligned_path)
660 if sparse_aligned_path.exists():
661 pycolmap.logging.info("Skipping alignment, as it already exists")
662 return
663
664 if sparse_path.exists():
665 sparse_aligned_path.mkdir(parents=True, exist_ok=True)
666 _run_with_log(
667 [
668 args.colmap_path,
669 "model_aligner",
670 "--input_path",
671 sparse_path,
672 "--ref_model_path",
673 sparse_gt_path,
674 "--output_path",
675 sparse_aligned_path,
676 "--alignment_max_error",
677 str(max_ref_model_error),
678 ],
679 sparse_aligned_path.parent / "alignment.log",
680 check=False,
681 )
682
683
684def process_scene(

Callers 1

process_sceneFunction · 0.85

Calls 1

_run_with_logFunction · 0.85

Tested by

no test coverage detected