fix import inside documentation and update TODO

This commit is contained in:
Julien Coste
2014-08-31 11:48:34 +01:00
parent 5ccc0d0000
commit 218eb4e89e
6 changed files with 14 additions and 12 deletions
+1
View File
@@ -3,6 +3,7 @@ Remember to list any API changes below in `doc/source/api_changes.txt`.
Version 0.13 Version 0.13
------------ ------------
* Remove deprecated `None` defaults for `skimage.exposure.rescale_intensity` * Remove deprecated `None` defaults for `skimage.exposure.rescale_intensity`
* Remove deprecated `skimage.filter.canny` import in __init__.py that is now in `skimage.feature.canny`
Version 0.12 Version 0.12
------------ ------------
@@ -57,7 +57,7 @@ segmentation. To do this, we first get the edges of features using the Canny
edge-detector. edge-detector.
""" """
from skimage.filter import canny from skimage.feature import canny
edges = canny(coins/255.) edges = canny(coins/255.)
fig, ax = plt.subplots(figsize=(4, 3)) fig, ax = plt.subplots(figsize=(4, 3))
+3 -3
View File
@@ -19,7 +19,7 @@ import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from scipy import ndimage from scipy import ndimage
from skimage import filter from skimage import feature
# Generate noisy image of a square # Generate noisy image of a square
@@ -31,8 +31,8 @@ im = ndimage.gaussian_filter(im, 4)
im += 0.2 * np.random.random(im.shape) im += 0.2 * np.random.random(im.shape)
# Compute the Canny filter for two values of sigma # Compute the Canny filter for two values of sigma
edges1 = filter.canny(im) edges1 = feature.canny(im)
edges2 = filter.canny(im, sigma=3) edges2 = feature.canny(im, sigma=3)
# display results # display results
fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(8, 3)) fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(8, 3))
@@ -37,16 +37,16 @@ Its size is extended by two times the larger radius.
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from skimage import data, filter, color from skimage import data, color
from skimage.transform import hough_circle from skimage.transform import hough_circle
from skimage.feature import peak_local_max from skimage.feature import peak_local_max, canny
from skimage.draw import circle_perimeter from skimage.draw import circle_perimeter
from skimage.util import img_as_ubyte from skimage.util import img_as_ubyte
# Load picture and detect edges # Load picture and detect edges
image = img_as_ubyte(data.coins()[0:95, 70:370]) image = img_as_ubyte(data.coins()[0:95, 70:370])
edges = filter.canny(image, sigma=3, low_threshold=10, high_threshold=50) edges = canny(image, sigma=3, low_threshold=10, high_threshold=50)
fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(5, 2)) fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(5, 2))
@@ -106,14 +106,15 @@ References
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from skimage import data, filter, color from skimage import data, color
from skimage.feature import canny
from skimage.transform import hough_ellipse from skimage.transform import hough_ellipse
from skimage.draw import ellipse_perimeter from skimage.draw import ellipse_perimeter
# Load picture, convert to grayscale and detect edges # Load picture, convert to grayscale and detect edges
image_rgb = data.coffee()[0:220, 160:420] image_rgb = data.coffee()[0:220, 160:420]
image_gray = color.rgb2gray(image_rgb) image_gray = color.rgb2gray(image_rgb)
edges = filter.canny(image_gray, sigma=2.0, edges = canny(image_gray, sigma=2.0,
low_threshold=0.55, high_threshold=0.8) low_threshold=0.55, high_threshold=0.8)
# Perform a Hough Transform # Perform a Hough Transform
+1 -1
View File
@@ -58,7 +58,7 @@ References
from skimage.transform import (hough_line, hough_line_peaks, from skimage.transform import (hough_line, hough_line_peaks,
probabilistic_hough_line) probabilistic_hough_line)
from skimage.filter import canny from skimage.feature import canny
from skimage import data from skimage import data
import numpy as np import numpy as np
@@ -38,11 +38,11 @@ Edge-based segmentation
Let us first try to detect edges that enclose the coins. For edge Let us first try to detect edges that enclose the coins. For edge
detection, we use the `Canny detector detection, we use the `Canny detector
<http://en.wikipedia.org/wiki/Canny_edge_detector>`_ of ``skimage.filter.canny`` <http://en.wikipedia.org/wiki/Canny_edge_detector>`_ of ``skimage.feature.canny``
:: ::
>>> from skimage.filter import canny >>> from skimage.feature import canny
>>> edges = canny(coins/255.) >>> edges = canny(coins/255.)
As the background is very smooth, almost all edges are found at the As the background is very smooth, almost all edges are found at the