How to Apply the Otsu Threshold Excluding Zero Values

Stefan van der Walt stefan at sun.ac.za
Fri Sep 26 11:15:48 EDT 2014


On 2014-09-26 08:03:24, vbubbly21 at gmail.com wrote:
> I want to use "skimage.filter.threshold_otsu(image, nbins=256)"  module 
> excluding the 0 values of my image while computing the threshold.

How about:

skimage.filter.threshold_otsu(image[image != 0], nbins=256)

Stéfan



More information about the scikit-image mailing list