mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 12:39:13 +08:00
DOC: minor example clean up.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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
|
||||
<http://en.wikipedia.org/wiki/Watershed_(image_processing)>`__ for
|
||||
more details on the algorithm.
|
||||
See Wikipedia_ for more details on the algorithm.
|
||||
|
||||
.. _Wikipedia: <http://en.wikipedia.org/wiki/Watershed_(image_processing)>
|
||||
|
||||
"""
|
||||
|
||||
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)))
|
||||
|
||||
Reference in New Issue
Block a user