affine
affine
#
fitted — a model's relative depth made metric by a measured depth map.
- Compare. The prediction is area-averaged down to the measured map's
grid; a pixel counts where the measurement is finite, further than
NEAREST_METERSand both confidences are above zero. - Solve. Monocular models are invariant up to an affine map in inverse
depth, so
1/d_metric ≈ a·x + bis fitted by iteratively reweighted least squares: the weight is the measured confidence times the model's, times a Huber weight on the residual, rescaled from the residuals' median absolute deviation each round. - Apply. The map is applied to the full-resolution prediction, the
inverse depth clamped to
1/FARTHEST_METERSso it stays positive; the result carries the model's confidence.
fitted(prediction, measured)
#
prediction in metres, its inverse depth affinely mapped onto measured.
One global affine map for the whole image is the model here; the fit is weighted by both confidences and robust to outliers in either map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prediction
|
RelativeDepth
|
A model's depth, in its own units, with its confidence. |
required |
measured
|
Depth
|
The metric reference, a captured LiDAR map at any size. |
required |
Returns:
| Type | Description |
|---|---|
Depth
|
Metric depth at the prediction's size, carrying the model's confidence. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If fewer than |