diff --git a/skimage/feature/__init__.py b/skimage/feature/__init__.py index b7046358..c63a773d 100644 --- a/skimage/feature/__init__.py +++ b/skimage/feature/__init__.py @@ -1,3 +1,3 @@ from hog import hog from greycomatrix import greycomatrix, greycoprops -from peak import peak_min_dist +from peak import peak_local_max diff --git a/skimage/feature/peak.py b/skimage/feature/peak.py index 55f6010c..225f42cd 100644 --- a/skimage/feature/peak.py +++ b/skimage/feature/peak.py @@ -2,12 +2,11 @@ import numpy as np from scipy import ndimage -def peak_min_dist(image, min_distance=10, threshold=0.1): +def peak_local_max(image, min_distance=10, threshold=0.1): """Return coordinates of peaks in an image. - Candidate peaks are determined by a relative `threshold`, and peaks that - are too close (as determined by `min_distance`) to larger peaks are - rejected. + Peaks are the local maxima in a region of `2 * min_distance + 1` + (i.e. peaks are separated by at least `min_distance`). Parameters ---------- diff --git a/skimage/feature/tests/test_peak.py b/skimage/feature/tests/test_peak.py index 99b9bc27..19f9e95f 100644 --- a/skimage/feature/tests/test_peak.py +++ b/skimage/feature/tests/test_peak.py @@ -11,7 +11,7 @@ def test_noisy_peaks(): for r, c in peak_locations: image[r, c] = 1 - peaks_detected = feature.peak_min_dist(image, min_distance=5) + peaks_detected = feature.peak_local_max(image, min_distance=5) assert len(peaks_detected) == len(peak_locations) for loc in peaks_detected: diff --git a/skimage/filter/harris.py b/skimage/filter/harris.py index 0298ddfe..feb848ac 100644 --- a/skimage/filter/harris.py +++ b/skimage/filter/harris.py @@ -79,7 +79,7 @@ def harris(image, min_distance=10, threshold=0.1, eps=1e-6, """ harrisim = _compute_harris_response(image, eps=eps, gaussian_deviation=gaussian_deviation) - coordinates = feature.peak_min_dist(harrisim, min_distance=min_distance, + coordinates = feature.peak_local_max(harrisim, min_distance=min_distance, threshold=threshold) return coordinates