Distance transform function by a brute force algorithm.
This function calculates the distance transform of the input, by replacing each background element (zero values), with its shortest distance to the foreground (any element non-zero).
In addition to the distance transform, the feature transform can be calculated. In this case the index of the closest background element is returned along the first axis of the result.
| Parameters: | input : array_like
metric : str, optional
sampling : {int, sequence of ints}, optional
return_distances : bool, optional
return_indices : bool, optional
distances : float64 ndarray, optional
indices : int64 ndarray, optional
|
|---|---|
| Returns: | distances : ndarray
indices : ndarray
|
Notes
This function employs a slow brute force algorithm, see also the function distance_transform_cdt for more efficient taxicab and chessboard algorithms.