Weighted Depth Fusion
Fuse multiple depth estimates using weighted averaging.
When we have depth estimates from multiple stereo pairs or viewpoints, we can combine them to get a more robust estimate. Weighted averaging gives more influence to confident estimates:
where:
- is the depth estimate from source
- is the confidence/weight for that estimate
- is the final fused depth
Weights typically come from matching confidence, geometric consistency, or photo consistency scores.
Example
fuse_depths([5.0, 5.2, 4.8], [1.0, 0.5, 0.5])
5.0
- Inputs:
depthsholds three estimates of the same point's distance, , andweightsholds how much each source is trusted, . Source 1 counts twice as much as each of the others. - Numerator: multiply each depth by its weight and add: .
- Denominator: the total weight, . Dividing by it rescales the weights so they act like fractions summing to 1 ().
- Output: , a single float rounded to 4 decimal places.
- Notice: the two low-confidence estimates sit symmetrically around 5.0 ( and ) with equal weight, so they cancel. If the weights were instead, the result would shift toward 5.2: .
Constraints
- depths: list of depth values from different sources
- weights: list of confidence weights (positive values)
- Return fused depth rounded to 4 decimal places