﻿# Depth Pro focal length: a camera value must match the image pixel grid

Preserve the Depth Pro focal-length input in pixel units and distinguish supplied camera evidence from estimated intrinsics when resizing or cropping images.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-depthpro-focal-length-pixel-contract/
Language: en

## Identify the source of the camera value

Depth Pro can use or estimate focal-length information in its metric-depth workflow. The [official project](https://github.com/apple-aiml-research/ml-depth-pro) shows image loading and inference with a focal-length argument. Record whether the application supplied that value from camera metadata or relied on the model's estimation path. These are different sources of evidence, and a plausible depth map does not independently prove that the camera input was correct.

## Preserve the documented unit

The [reference inference code](https://github.com/apple-aiml-research/ml-depth-pro/blob/main/src/depth_pro/depth_pro.py) defines the optional `f_px` input in pixels corresponding to the image. A focal length in physical millimetres is not interchangeable with that pixel-valued quantity. Converting between them requires the relevant sensor and image geometry. Do not copy a convenient EXIF number directly into an argument merely because both values are called focal length in different parts of the application.

## Account for external image transformations

If the application resizes an image before entering the supported inference procedure, its camera parameters must remain consistent with the resulting pixel grid. Cropping can also change the camera interpretation used by downstream reconstruction. Keep these external operations distinct from transformations already handled inside the chosen implementation. Applying an extra correction after the library has accounted for a transformation can be as misleading as omitting the correction entirely.

## Separate estimated intrinsics from measured calibration

The [research paper](https://arxiv.org/abs/2410.02073) describes focal-length estimation as part of the method. An estimate remains a model output requiring evaluation on the intended imagery. Do not relabel it as measured camera calibration when exporting a reconstruction package. Preserve the source and unit of the camera value with the depth result so a later consumer can distinguish supplied metadata, a converted parameter and an inferred quantity.

## Test the complete camera contract

Use a controlled image transformation and inspect the actual image and focal-length values delivered to inference. Compare the numerical depth under a protocol appropriate to the task, rather than judging only a colorized preview. Related guides on [EXIF orientation](/journal/data-guide-image-exif-box-coordinate/) and [data provenance](/journal/document-markdown-json-provenance/) provide supporting concepts. Depth Pro's specific boundary is the camera-to-image relationship: the unit, source and pixel grid of the supplied parameter must remain explicit throughout processing.
