input, structure="chessboard", return_distances=True, return_indices=False, distances=None, indices=None) |
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. The return_distances, and return_indices flags can be used to indicate if the distance transform, the feature transform, or both must be returned.
The distances and indices arguments can be used to give optional output arrays that must be of the correct size and type (both Int32).
The basics of the algorithm used to implement this function is described in: G. Borgefors, "Distance transformations in arbitrary dimensions.", Computer Vision, Graphics, and Image Processing, 27:321-345, 1984.
input, sampling=None, return_distances=True, return_indices=False, distances=None, indices=None) |
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. The return_distances, and return_indices flags can be used to indicate if the distance transform, the feature transform, or both must be returned.
Optionally the sampling along each axis can be given by the sampling parameter which should be a sequence of length equal to the input rank, or a single number in which the sampling is assumed to be equal along all axes.
The distances and indices arguments can be used to give optional output arrays that must be of the correct size and type (Float64 and Int32).
The algorithm used to implement this function is described in: C. R. Maurer, Jr., R. Qi, and V. Raghavan, "A linear time algorithm for computing exact euclidean distance transforms of binary images in arbitrary dimensions. IEEE Trans. PAMI 25, 265-270, 2003.
input, metric="euclidean", sampling=None, return_distances=True, return_indices=False, distances=None, indices=None) |
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. The return_distances, and return_indices flags can be used to indicate if the distance transform, the feature transform, or both must be returned.
Optionally the sampling along each axis can be given by the sampling parameter which should be a sequence of length equal to the input rank, or a single number in which the sampling is assumed to be equal along all axes. This parameter is only used in the case of the euclidean distance transform.
The distances and indices arguments can be used to give optional output arrays that must be of the correct size and type (Float64 and Int32).
Note: This function uses a slow brute-force algorithm, the function distance_transform_cdt can be used to more efficiently calculate cityblock and chessboard distance transforms. The function distance_transform_edt can be used to more efficiently calculate the exact euclidean distance transform.
Send comments to the NumArray community.