Unexpected behaviour in peak_local_max

Guillaume Gay guillaume at mitotic-machine.org
Fri Apr 13 06:18:13 EDT 2012


Hi all,

When calling feature.peak_local_max() on a flat image, all the points of 
the image are returned:

 >>> test_image = np.ones((10,10))
 >>> coords = feature.peak_local_max()
 >>> len(coords)
  100

I wouldn't expect that... It originates from two things in the code:

1. The calculated thershold can be higher than the min  of the image:

     corner_threshold = np.max(image.ravel()) * threshold

2. All points higher *or equal* to the threshold are retrieved:

     image_t = (image >= corner_threshold) * 1

So for me this is a bit strange, and is really bad when you have an 
empty frame on a sequence, which tends to happen. Also I think the 
threshold argument is a bit unusual, I more often expect an absolute 
value for the threshold, not a relative one.






-------------- next part --------------
A non-text attachment was scrubbed...
Name: guillaume.vcf
Type: text/x-vcard
Size: 282 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20120413/4aad6b79/attachment.vcf>


More information about the scikit-image mailing list