Skip to content

depth

depth #

depth_seed — each frame's confident captured depth pixels back-projected through its pose.

DEPTH_CONFIDENCE = 0.5 module-attribute #

The least confidence a captured depth pixel needs to seed a point.

depth_seed(frames) #

The frames' captured depth pixels as coloured world points.

Each frame contributes its confident depth pixels, evenly thinned to POINTS_PER_FRAME, back-projected through its pose; a frame without depth contributes nothing.

Parameters:

Name Type Description Default
frames Array[PosedImage]

The posed images.

required
Source code in capturegraph-recipes/capturegraph_recipes/splats/seeds/depth.py
@cg.pure_function("splats.depth_seed/1")
def depth_seed(frames: cg.Array[PosedImage]) -> cg.PointCloud:
    """The frames' captured depth pixels as coloured world points.

    Each frame contributes its confident depth pixels, evenly thinned to
    ``POINTS_PER_FRAME``, back-projected through its pose; a frame without
    depth contributes nothing.

    Args:
        frames: The posed images.
    """
    positions: list[np.ndarray] = []
    colors: list[np.ndarray] = []
    for frame in cg.logging.progress(frames, label="Seeding frames"):
        if cg.is_missing(frame.depth):
            continue
        points, shades = _from_depth(frame)
        positions.append(points)
        colors.append(shades)
    return cloud("Seeded from depth", positions, colors)