A Near-Linear Time Algorithm for the Chamfer Distance