I wanted to calculate the distance between two 3D point clouds with at least 2000 points using Earth Mover's Distance with the following code, however, it is too slow and does not work properly. So, is there any way to calculate it for approximate it faster?
from scipy.spatial.distance import cdist
from scipy.optimize import linear_sum_assignment
def emd(self):
d = cdist(self.X, self.Y)
assignment = linear_sum_assignment(d)
return d[assignment].sum() / min(len(self.X), len(self.Y))