From 38525fb4237a27fda87cacc2f523dccd202414f8 Mon Sep 17 00:00:00 2001 From: radioxoma Date: Mon, 13 Jan 2014 19:46:10 +0300 Subject: [PATCH] Explanation by ahojnnes --- skimage/filter/thresholding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/filter/thresholding.py b/skimage/filter/thresholding.py index 86f380dd..6ccf8f6b 100644 --- a/skimage/filter/thresholding.py +++ b/skimage/filter/thresholding.py @@ -237,8 +237,8 @@ def threshold_isodata(image, nbins=256): # returns `bin_centers` containing only one value. Speed up with it. if bin_centers.size == 1: return bin_centers[0] - # It is not necessary to calculate probability mass function in this case - # since the l and h fractions are reduced. + # It is not necessary to calculate the probability mass function here, + # because the l and h fractions already include the normalization. pmf = hist.astype(np.float32) # / hist.sum() cpmfl = np.cumsum(pmf, dtype=np.float32) cpmfh = np.cumsum(pmf[::-1], dtype=np.float32)[::-1]