This week I optimized the edge error code. Originally, I was using Edward Cui’s code for the modified Hausdorff, but after slow computation times, I reimplemented the algorithm myself, which was a lot simpler than I had previously thought. Cui’s implementation imported numpy.core.umath_tests, which apparently is deprecated and runs rather slowly. Instead I call the scipy.spatial_distance.directed_hausdorff function, and use the max of the forward and reverse directed hausdorff distances as my distance metric. This is described in Comparing Images Using the Hausdorff Distance by Huttenlocher.