From 520c961a0c381bf1f99f0afa42e8d13868e98a8f Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Mon, 20 Feb 2012 09:45:17 -0500 Subject: [PATCH] DOC: minor example clean up. --- doc/examples/plot_gabors_from_lena.py | 10 +++++----- doc/examples/plot_hog.py | 1 - doc/examples/plot_watershed.py | 11 ++++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/examples/plot_gabors_from_lena.py b/doc/examples/plot_gabors_from_lena.py index 06f7e0bb..174c425a 100644 --- a/doc/examples/plot_gabors_from_lena.py +++ b/doc/examples/plot_gabors_from_lena.py @@ -31,11 +31,11 @@ is not rocket science. .. [3] http://en.wikipedia.org/wiki/Receptive_field .. [4] http://en.wikipedia.org/wiki/K-means_clustering .. [5] http://en.wikipedia.org/wiki/Lateral_geniculate_nucleus -.. [6] D. H. Hubel and T. N. Wiesel Receptive Fields of Single Neurones -in the Cat's Striate Cortex J. Physiol. pp. 574-591 (148) 1959 -.. [7] D. H. Hubel and T. N. Wiesel Receptive Fields, Binocular -Interaction and Functional Architecture in the Cat's Visual Cortex J. -Physiol. 160 pp. 106-154 1962 +.. [6] D. H. Hubel and T. N., Wiesel Receptive Fields of Single Neurones + in the Cat's Striate Cortex, J. Physiol. pp. 574-591 (148) 1959 +.. [7] D. H. Hubel and T. N., Wiesel Receptive Fields, Binocular + Interaction, and Functional Architecture in the Cat's Visual Cortex, + J. Physiol. 160 pp. 106-154 1962 """ import numpy as np diff --git a/doc/examples/plot_hog.py b/doc/examples/plot_hog.py index 4d0380bd..81aa202a 100644 --- a/doc/examples/plot_hog.py +++ b/doc/examples/plot_hog.py @@ -82,7 +82,6 @@ References from skimage.feature import hog from skimage import data, color, exposure -import numpy as np import matplotlib.pyplot as plt image = color.rgb2gray(data.lena()) diff --git a/doc/examples/plot_watershed.py b/doc/examples/plot_watershed.py index c2d1461a..e9699642 100644 --- a/doc/examples/plot_watershed.py +++ b/doc/examples/plot_watershed.py @@ -19,9 +19,10 @@ opposite of the distance) are chosen as markers, and the flooding of basins from such markers separates the two circles along a watershed line. -See `Wikipedia -`__ for -more details on the algorithm. +See Wikipedia_ for more details on the algorithm. + +.. _Wikipedia: + """ import numpy as np @@ -36,9 +37,9 @@ r1, r2 = 16, 20 mask_circle1 = (x - x1)**2 + (y - y1)**2 < r1**2 mask_circle2 = (x - x2)**2 + (y - y2)**2 < r2**2 image = np.logical_or(mask_circle1, mask_circle2) + # Now we want to separate the two objects in image -# Generate the markers as local maxima of the distance -# to the background +# Generate the markers as local maxima of the distance to the background from scipy import ndimage distance = ndimage.distance_transform_edt(image) local_maxi = is_local_maximum(distance, image, np.ones((3, 3)))