https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.morphology.distance_transform_edt.html
I\'m having trouble understanding how the Euclidean dist
Warren has already explained how distance_transform_edt
works.
In your case,you could change sampling units along x and y
ndimage.distance_transform_edt(a)
array([[ 0., 0., 0., 0., 0.],
[ 0., 1., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 1., 0.],
[ 0., 0., 0., 0., 0.]])
But
>>> ndimage.distance_transform_edt(a, sampling=[2,2])
array([[ 0., 0., 0., 0., 0.],
[ 0., 2., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 2., 0.],
[ 0., 0., 0., 0., 0.]])
Or
ndimage.distance_transform_edt(a, sampling=[3,3])
array([[ 0., 0., 0., 0., 0.],
[ 0., 3., 0., 0., 0.],
[ 0., 0., 0., 0., 0.],
[ 0., 0., 0., 3., 0.],
[ 0., 0., 0., 0., 0.]])