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
)
| 482 | |
| 483 | |
| 484 | def 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 | |
| 514 | def run_perspective( |
no test coverage detected