From 0936522064dd15daf856885b34fd6e513a55559e Mon Sep 17 00:00:00 2001 From: Geoffrey French Date: Mon, 1 Sep 2014 22:44:45 +0100 Subject: [PATCH] Improved plot_windowed_histogram doctoring, removed unnecessary imports and removed an internal testing line. --- doc/examples/plot_windowed_histogram.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/examples/plot_windowed_histogram.py b/doc/examples/plot_windowed_histogram.py index cfa9345d..6d8f9ed0 100644 --- a/doc/examples/plot_windowed_histogram.py +++ b/doc/examples/plot_windowed_histogram.py @@ -4,13 +4,13 @@ from __future__ import division Sliding window histogram ======================== -This example extracts a single coin from the coins image and generates a -histogram of its greyscale values. +This example extracts a single coin from the `skimage.data.coins` image and +generates a histogram of its greyscale values. It then computes a sliding window histogram of the complete image using -rank.windowed_histogram. The local histogram for the region surrounding -each pixel in the image is compared to that of the single coin, with -a similarity measure being computed and displayed. +`skimage.filter.rank.windowed_histogram`. The local histogram for the region +surrounding each pixel in the image is compared to that of the single coin, +with a similarity measure being computed and displayed. To demonstrate the rotational invariance of the technique, the same test is performed on a version of the coins image rotated by 45 degrees. @@ -20,9 +20,7 @@ import matplotlib import matplotlib.pyplot as plt from skimage import data -from skimage.util.dtype import dtype_range from skimage.util import img_as_ubyte -from skimage import exposure from skimage.morphology import disk from skimage.filter import rank from skimage import transform @@ -57,9 +55,8 @@ def windowed_histogram_similarity(image, selem, reference_hist, n_bins): return similarity -# Load the coins image +# Load the `skimage.data.coins` image img = img_as_ubyte(data.coins()) -# img = img_as_ubyte(plt.imread('../../skimage/data/coins.png')) # Quantize to 16 levels of grayscale; this way the output image will have a # 16-dimensional feature vector per pixel