mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
BUG - Now parsing all unique labels != 0 properly, and set threshold_rel=0 in is_local_maximum() wrapper.
This commit is contained in:
@@ -106,8 +106,10 @@ def peak_local_max(image, min_distance=10, threshold_abs=0, threshold_rel=0.1,
|
||||
labels[mask] = rank_order(labels[mask])[0].astype(labels.dtype)
|
||||
labels = labels.astype(np.int32)
|
||||
|
||||
# New values for new ordering
|
||||
label_values = np.unique(labels)
|
||||
out = np.zeros_like(image)
|
||||
for label in labels:
|
||||
for label in label_values[label_values != 0]:
|
||||
maskim = (labels == label)
|
||||
out += peak_local_max(image * maskim, min_distance=min_distance,
|
||||
threshold_abs=threshold_abs,
|
||||
|
||||
@@ -294,8 +294,8 @@ def is_local_maximum(image, labels=None, footprint=None):
|
||||
|
||||
"""
|
||||
return peak_local_max(image, labels=labels, min_distance=1,
|
||||
footprint=footprint, indices=False,
|
||||
exclude_border=False)
|
||||
threshold_rel=0, footprint=footprint,
|
||||
indices=False, exclude_border=False)
|
||||
|
||||
|
||||
# ---------------------- deprecated ------------------------------
|
||||
|
||||
Reference in New Issue
Block a user