> ## Documentation Index
> Fetch the complete documentation index at: https://docs.generalrobotics.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# FoundationStereo

> Stereo depth estimation from a left/right image pair

Estimate depth from a stereo image pair using FoundationStereo.

## Parameters

<ParamField body="left_image" type="str | PIL.Image | np.ndarray" required>
  Left stereo image.
</ParamField>

<ParamField body="right_image" type="str | PIL.Image | np.ndarray" required>
  Right stereo image.
</ParamField>

<ParamField body="aux_args" type="Dict[str, Any]">
  Camera parameters:

  * `K` — 3x3 camera intrinsics matrix
  * `baseline` — Stereo baseline in meters
  * `hiera` — Hierarchy level (0–2)
  * `valid_iters` — Number of valid iterations
</ParamField>

<ParamField body="timeout" type="float | None">
  Optional HTTP timeout.
</ParamField>

## Returns

`np.ndarray` — Depth map of shape `(H, W)` with dtype `float32`. Values in meters.

## Example

```python theme={null}
from grid_cortex_client import CortexClient
import numpy as np
from PIL import Image

client = CortexClient()
K = np.array([[525, 0, 320], [0, 525, 240], [0, 0, 1]], dtype=np.float32)
aux = {"K": K, "baseline": 0.1, "hiera": 0, "valid_iters": 32}
left = Image.open("left.jpg")
right = Image.open("right.jpg")

depth = client.run(
    model_id="foundationstereo",
    left_image=left,
    right_image=right,
    aux_args=aux,
)
print(depth.shape)  # (480, 640)
```
