From 6a6e273d0679e35237db877056b4e85e8ca41e56 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Fri, 9 Dec 2011 10:16:23 -0500 Subject: [PATCH] Remove thresholding example from user guide in favor of docstring example. --- doc/examples/plot_otsu.py | 23 ----------------------- skimage/thresholding/thresholding.py | 6 ++++++ 2 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 doc/examples/plot_otsu.py diff --git a/doc/examples/plot_otsu.py b/doc/examples/plot_otsu.py deleted file mode 100644 index 03534bc9..00000000 --- a/doc/examples/plot_otsu.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -============ -Thresholding -============ - -Thresholding is used to create a binary image. This example uses Otsu's method to calculate the threshold value. - -""" - -import matplotlib.pyplot as plt - -from skimage.data import camera -from skimage.thresholding import threshold_otsu - - -image = camera() -thresh = threshold_otsu(camera()) -binary = image > thresh - -plt.imshow(binary) -plt.axis('off') -plt.show() - diff --git a/skimage/thresholding/thresholding.py b/skimage/thresholding/thresholding.py index b274010f..861d2647 100644 --- a/skimage/thresholding/thresholding.py +++ b/skimage/thresholding/thresholding.py @@ -24,6 +24,12 @@ def threshold_otsu(image, bins=256): ---------- .. [1] Wikipedia, http://en.wikipedia.org/wiki/Otsu's_Method + Examples + -------- + >>> from skimage.data import camera + >>> image = camera() + >>> thresh = threshold_otsu(camera()) + >>> binary = image > thresh """ hist, bin_centers = histogram(image, bins) hist = hist.astype(float)