geodesic distance transform in python
问题 In python there is the distance_transform_edt function in the scipy.ndimage.morphology module. I applied it to a simple case, to compute the distance from a single cell in a masked numpy array. However the function remove the mask of the array and compute, as expected, the Euclidean distance for each cell, with non null value, from the reference cell, with the null value. Below is an example I gave in my blog post: %pylab from scipy.ndimage.morphology import distance_transform_edt l = 100 x,