mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-10 12:35:06 +08:00
Rename peak_min_dist to peak_local_max.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
----------
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user