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

Function run_spherical

python/examples/panorama_sfm.py:484–511  ·  view source on GitHub ↗

Reconstruct directly on the equirectangular panoramas with the native EQUIRECTANGULAR camera model, without rendering perspective images.

(
    args: argparse.Namespace, database_path: Path, rec_path: Path
)

Source from the content-addressed store, hash-verified

482
483
484def run_spherical(
485 args: argparse.Namespace, database_path: Path, rec_path: Path
486) -> None:
487 """Reconstruct directly on the equirectangular panoramas with the native
488 EQUIRECTANGULAR camera model, without rendering perspective images."""
489
490 logging.info("Reconstructing with spherical camera")
491
492 reader_options = pycolmap.ImageReaderOptions(camera_model="EQUIRECTANGULAR")
493 pycolmap.extract_features(
494 database_path,
495 args.input_image_path,
496 reader_options=reader_options,
497 camera_mode=pycolmap.CameraMode.SINGLE,
498 )
499
500 # A single EQUIRECTANGULAR camera observes the whole sphere from one
501 # center, so there is no rig and no per-frame image-pair skipping.
502 run_matcher(args, database_path, pycolmap.FeatureMatchingOptions())
503
504 # The EQUIRECTANGULAR model has no focal length, principal point, or
505 # distortion to refine; its (w, h) params are held constant in bundle
506 # adjustment.
507 recs = pycolmap.incremental_mapping(
508 database_path, args.input_image_path, rec_path
509 )
510 for idx, rec in recs.items():
511 logging.info(f"#{idx} {rec.summary()}")
512
513
514def run_perspective(

Callers 1

runFunction · 0.85

Calls 2

run_matcherFunction · 0.85

Tested by

no test coverage detected