skimage2.feature.corner_peaks#
- skimage2.feature.corner_peaks(image, min_distance=1, threshold_abs=None, threshold_rel=None, exclude_border=1, indices=True, num_peaks=inf, footprint=None, labels=None, *, num_peaks_per_label=inf, p_norm=inf)[source]#
Find peaks in corner measure response image.
This differs from
skimage.feature.peak_local_maxin that it suppresses multiple connected peaks with the same accumulator value.- Parameters:
- imagendarray of shape (M, N)
Input image.
- min_distanceint, optional
The minimal allowed distance separating peaks.
- **
- p_normfloat
Which Minkowski p-norm to use. Should be in the range [1, inf]. A finite large p may cause a ValueError if overflow can occur.
infcorresponds to the Chebyshev distance and 2 to the Euclidean distance.
- Returns:
- outputndarray or ndarray of bools
If
indices = True: (row, column, …) coordinates of peaks.If
indices = False: Boolean array shaped likeimage, with peaks represented by True values.
See also
Notes
Changed in version 0.18: The default value of
threshold_relhas changed to None, which corresponds to lettingskimage.feature.peak_local_maxdecide on the default. This is equivalent tothreshold_rel=0.The
num_peakslimit is applied before suppression of connected peaks. To limit the number of peaks after suppression, setnum_peaks=np.infand post-process the output of this function.Examples
>>> from _skimage2.feature import peak_local_max >>> response = np.zeros((5, 5)) >>> response[2:4, 2:4] = 1 >>> response array([[0., 0., 0., 0., 0.], [0., 0., 0., 0., 0.], [0., 0., 1., 1., 0.], [0., 0., 1., 1., 0.], [0., 0., 0., 0., 0.]]) >>> peak_local_max(response) array([[2, 2], [2, 3], [3, 2], [3, 3]]) >>> corner_peaks(response) array([[2, 2]])