peak_local_max() Question.

147 views
Skip to first unread message

Claiborne Morton

unread,
Mar 12, 2015, 2:15:49 PM3/12/15
to scikit...@googlegroups.com
Hey guys,

     I am currently using this function for water-shedding in a project of mine. I am a bit curious as to what the parameter, threshold_abs is actually doing. The website here: http://scikit-image.org/docs/dev/api/skimage.feature.html#skimage.feature.peak_local_max says "Minimum intensity of peaks", but I am not sure how this applies to a binary image where intensity of a pixel is either 1 or zero. When set the parameter equal to an integer, say 12, it removes the smaller particles from the image, which is nice because that is something I need to do, but I am just not sure why it does this. Below is a comparison of the results with and with out the parameter. Could someone please explain what is happening?

Images are attached for:
      With threshold_abs = 12
      Without threshold_abs (I assume default is threshold_abs = zero?)
  
Thresh_12.png
Without_Thresh.png

Sigmund

unread,
Mar 12, 2015, 3:05:42 PM3/12/15
to scikit...@googlegroups.com
funny! Struggling with the same function at the same time.
All I can say. Yes, it behaves funny and it stops being funny when you change line 141 in Lib\site-packages\skimage\feature\peak.py
the max() has to be a min()

Siggi

Sigmund

unread,
Mar 12, 2015, 3:42:05 PM3/12/15
to scikit...@googlegroups.com
but only if you want your absolute threshold to be smaller than the default relative threshold which is 0.1 .

In my opinion it would be better if the options "threshold_abs" and "threshold_rel" can't coexist. 

btw I'm referring to version='0.9.3'

siggi

Stéfan van der Walt

unread,
Mar 12, 2015, 6:11:18 PM3/12/15
to scikit-image
It is know that the API of this function is problematic, and I'd like
to see it fixed. But it means we will need someone to do some careful
evaluation and propose fixes. Sigmund, Claiborne, would you be
interested in helping us figure this one out?

Stéfan
Reply all
Reply to author
Forward
0 new messages