> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/ai-blocks/depth-estimation-depthany-v2.md).

# Depth Estimation (DepthAny. V2)

This function block estimates per-pixel depth (distance) from a single RGB/BGR image. It produces a colorized depth visualization and a grayscale depth map that you can view, log, or feed to other processing blocks.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image` RGB/BGR image used as the input for depth estimation.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Depth Vis` Colorized visualization of estimated depth (easy to inspect).

`Depth Map` Grayscale depth map normalized to 0–255 (useful for analysis and downstream blocks).

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Model Size` Choose the model accuracy / speed trade-off. Options typically include Small, Base, and Large.\
`Max Size` Slider to limit the largest image dimension used during processing. Larger values give more detail but require more processing time.

## 🎨 Features <a href="#features" id="features"></a>

* Produces both a visual depth map and a raw grayscale depth image for flexible use.
* Model selection control lets you trade inference speed for accuracy.
* `Max Size` prevents very large images from slowing down processing; the block automatically resizes inputs for efficient inference.
* Automatically uses available processing resources to give best possible throughput (UI-level behavior).

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

When the block runs it takes the current input image, optionally resizes it to respect the `Max Size` setting, processes it with the selected model size, and returns the two outputs: a color visualization and a normalized grayscale depth map. Larger models and larger `Max Size` values increase processing time.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Connect an image-producing block to the `Image` input.
2. Select a `Model Size` based on the accuracy vs. speed you need.
3. Adjust `Max Size` to limit processing time while preserving enough detail.
4. Use the `Depth Vis` to quickly inspect results; use `Depth Map` as numeric input for other processing blocks.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* For very large images, use `Image Resizer` before this block to reduce processing time while preserving the important area.
* If the input image is low-resolution, try running `Super Resolution` upstream to improve detail before depth estimation.
* To visually inspect outputs in your workflow, connect `Depth Vis` to the `Show Image` block.
* Save results automatically by sending `Depth Vis` or `Depth Map` to `Image Logger` or `Image Write`.
* When experimenting, start with `Model Size` set to Small to get quick feedback, then switch to Base or Large once settings are stable.

(hint: recommended companion blocks — `Image Resizer`, `Super Resolution`, `Show Image`, `Image Logger`, `Image Write`)

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* If processing is too slow: lower `Model Size` or reduce `Max Size`.
* If results look coarse: increase `Max Size` or try a larger `Model Size` (if processing resources allow).
* If no output appears or the block stalls: ensure the upstream image block is supplying valid image frames.
* If you need to keep recent results available for review, route outputs to `Image Logger` or `Show Image` to confirm expectations.
