Skip to content

Instantly share code, notes, and snippets.

@AxoyTO
Created December 10, 2021 09:15
Show Gist options
  • Select an option

  • Save AxoyTO/82a85e59742417466c27bbd0493031d6 to your computer and use it in GitHub Desktop.

Select an option

Save AxoyTO/82a85e59742417466c27bbd0493031d6 to your computer and use it in GitHub Desktop.
def hausdorff(model_1_vertices, model_2_vertices):
model_1_vertices = np.array(model_1_vertices[:-1]).reshape(-1, 1)
model_2_vertices = np.array(model_2_vertices[:-1]).reshape(-1, 1)
dist = cdist(model_1_points, model_2_points)
hausdorff_dist = max(dist.min(axis=0).max(), dist.min(axis=1).max())
return hausdorff_dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment