Skip to content
DeepForgeby svx
All problems
HardComputer Visioncv-257

Chamfer Distance

Problem

Compute the symmetric chamfer distance between two point sets.

Add the mean minimum squared Euclidean distance from A to B and from B to A, then round to 4 decimal places.

Test cases

case 1
in: [[[0,0],[1,0]],[[0,0],[1,0]]]
expected: 0
case 2
in: [[[0,0]],[[3,4]]]
expected: 50
case 3
in: [[[0,0],[0,1]],[[0,0],[0,2]]]
expected: 1
Starter codePython
def chamfer_distance(a, b):
    # Your code here
    pass

3 test cases · run your code against them in the editor