Skip to content

panorama

panorama #

panorama_dataset — a panorama sweep's frames as posed images, placed by GPS and compass.

  1. Rotation. An Angle is device-to-world in the X-north / Y-west / Z-up frame with the device x-right, y-up and -z-forward: already the OpenGL camera a Pose carries, in a world that is not y-up. F turns that world into the one every reconstruction shares: north to x, up to y, east to z.
  2. Centre. location's offset from anchor on the local tangent plane (sfm.geo.local_offset), already in that world; sessions anchored at one location share it, and the frames of one sweep share their centre.
  3. Intrinsics. The angle's focal length and principal point at their reference size, else a centred pinhole from its fields of view at the image's own size; a frame with neither is left out.

panorama_dataset(panorama, location, anchor, max_dimension=1600) #

The frames of panorama as posed images at location's offset from anchor.

Every frame shares the centre and takes its rotation from its compass angle; depth is Missing. A frame without intrinsics or fields of view is left out.

Parameters:

Name Type Description Default
panorama ImagePanorama

The oriented frames of one sweep.

required
location Location

Where the sweep was taken.

required
anchor Location

The location the world's origin sits at, shared by every sweep that should land in one world.

required
max_dimension int

The longest image side, in pixels, as written.

1600
Source code in capturegraph-recipes/capturegraph_recipes/splats/datasets/panorama.py
@cg.pure_function("splats.panorama_dataset/1")
def panorama_dataset(
    panorama: cg.ImagePanorama,
    location: cg.Location,
    anchor: cg.Location,
    max_dimension: int = 1600,
) -> cg.Array[PosedImage]:
    """The frames of ``panorama`` as posed images at ``location``'s offset from ``anchor``.

    Every frame shares the centre and takes its rotation from its compass
    angle; depth is ``Missing``. A frame without intrinsics or fields of view
    is left out.

    Args:
        panorama: The oriented frames of one sweep.
        location: Where the sweep was taken.
        anchor: The location the world's origin sits at, shared by every
            sweep that should land in one world.
        max_dimension: The longest image side, in pixels, as written.
    """
    centre = local_offset(location, anchor)
    frames = [
        frame
        for frame in panorama.frames
        if not cg.is_missing(frame.image) and _has_camera(frame.angle)
    ]
    posed: list[PosedImage] = []
    for frame in cg.logging.progress(frames, label="Decoding frames"):
        picture = frame.image.pil()
        posed.append(
            posed_frame(picture, _pose(frame, picture.size, centre), cg.Missing, max_dimension)
        )
    return cg.Array[PosedImage](posed)