Skip to content

reconstruction

reconstruction #

Reconstruction — the cameras, points and observations one sparse model holds.

cameras is keyed by each image's position in the array the model was built from, as decimal text: camera_key spells a position, camera_index reads one back. An absent key is an unregistered image and chains as Missing.

Reconstruction #

Bases: Struct

A sparse model: solved cameras, the points they see, and which keypoint saw which.

cameras is keyed by camera_key(position) of the input array, so model.cameras["3"] is the fourth image's pose and an absent key is an unregistered image, chaining as Missing; points is a seed in its own right; observations ties each point to the keypoints it was triangulated from.

Source code in capturegraph-recipes/capturegraph_recipes/types/compositions/reconstruction.py
class Reconstruction(cg.Struct):
    """A sparse model: solved cameras, the points they see, and which keypoint saw which.

    ``cameras`` is keyed by ``camera_key(position)`` of the input array, so
    ``model.cameras["3"]`` is the fourth image's pose and an absent key is an
    unregistered image, chaining as ``Missing``; ``points`` is a seed in its
    own right; ``observations`` ties each point to the keypoints it was
    triangulated from.
    """

    analysis_only = True

    cameras: cg.Map[cg.String, cg.Pose]
    points: cg.PointCloud
    observations: Observations

camera_index(key) #

The array position a cameras key names.

Source code in capturegraph-recipes/capturegraph_recipes/types/compositions/reconstruction.py
def camera_index(key: object) -> int:
    """The array position a ``cameras`` key names."""
    return int(cg.String.key_encode(key))

camera_key(index) #

The cameras key of the image at index of the array a model was built from.

Source code in capturegraph-recipes/capturegraph_recipes/types/compositions/reconstruction.py
def camera_key(index: int) -> str:
    """The ``cameras`` key of the image at ``index`` of the array a model was built from."""
    return str(index)