Rename peak_min_dist to peak_local_max.

This commit is contained in:
Tony S Yu
2012-02-02 22:33:57 -05:00
parent 8bb8d93552
commit 1c9b340fe6
4 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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
+3 -4
View File
@@ -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
----------
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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