skimage.feature.peak_local_max behaviour

Sigmund siggin at gmail.com
Fri Jan 16 04:59:36 EST 2015


Since nothing has happened here and I'm back at my office some examples:

*normal behavior:*

>>> img1 = np.zeros((7, 7))>>> img1[3, 4] = 1>>> img1[3, 2] = 1.5>>> img1array([[ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  1.5,  0. ,  1. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ]])
>>> peak_local_max(img1, min_distance=1)array([[3, 2],       [3, 4]])

>>> peak_local_max(img1, min_distance=2)array([[3, 2]])


*now the, in my opinion, not normal behavior: *

  

>>> img1 = np.zeros((7, 7))>>> img1[3, 4] = 1>>> img1[3, 2] = 1>>> img1array([[ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  1. ,  0. ,  1. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ],       [ 0. ,  0. ,  0. ,  0. ,  0. ,  0. ,  0. ]])
>>> peak_local_max(img1, min_distance=1)array([[3, 2],       [3, 4]])

>>> peak_local_max(img1, min_distance=2)
array([[3, 2],       [3, 4]])






*Thanks again!Siggi*


Am Freitag, 16. Januar 2015 00:48:45 UTC+1 schrieb Sigmund:
>
> Hi, 
> My first post a few hours ago somehow didn't appear. It was with examples 
> but I trink I can make my paint without. 
> If two peaks with the same value are within the min_distance range they 
> are not detectes as too closer and reduced to one. Just use the provided 
> examples in the doc and change the peaks to the same value.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150116/e909f026/attachment.html>


More information about the scikit-image mailing list