mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-17 11:26:12 +08:00
Add docstring comment about flat peaks.
This commit is contained in:
@@ -10,6 +10,9 @@ def peak_local_max(image, min_distance=10, threshold='deprecated',
|
||||
Peaks are the local maxima in a region of `2 * min_distance + 1`
|
||||
(i.e. peaks are separated by at least `min_distance`).
|
||||
|
||||
NOTE: If peaks are flat (i.e. multiple pixels have exact same intensity),
|
||||
the coordinates of all pixels are returned.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
image: ndarray of floats
|
||||
|
||||
@@ -43,6 +43,13 @@ def test_constant_image():
|
||||
assert len(peaks) == 0
|
||||
|
||||
|
||||
def test_flat_peak():
|
||||
image = np.zeros((5, 5), dtype=np.uint8)
|
||||
image[1:3, 1:3] = 10
|
||||
peaks = peak.peak_local_max(image, min_distance=1)
|
||||
assert len(peaks) == 4
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from numpy import testing
|
||||
testing.run_module_suite()
|
||||
|
||||
Reference in New Issue
Block a user