All problems
Depth from Disparity
Problem
Compute depth from stereo disparity with depth = fx * baseline / disparity.
Round the result to 4 decimal places and return 0.0 when disparity is 0.
Test cases
case 1
in: [2,100,0.5]
expected: 25
case 2
in: [0,100,0.5]
expected: 0
case 3
in: [5,50,2]
expected: 20
Starter codePython
def depth_from_disparity(disparity, fx, baseline):
# Your code here
pass3 test cases · run your code against them in the editor