Loading...
Given a disparity map, focal length f, and baseline b, compute the depth map using the stereo depth equation.
In a rectified stereo system, depth Z is inversely proportional to disparity d:
Z=df⋅b
where:
For zero disparity (no correspondence found), set the depth to infinity (float('inf')).
Return the depth map as a 2D list with values rounded to 4 decimal places.
disparity_map = [[10, 20, 0],
[5, 15, 25]]
focal_length = 500.0
baseline = 0.1[[5.0, 2.5, inf], [10.0, 3.3333, 2.0]]
float('inf').