Visit the wiki pages to find some additional documentation and instructions on how view an interactive verson of these notebooks using binder.

In [9]:
%matplotlib inline
In [10]:
import math
import numpy as np
import matplotlib.pyplot as plt


from skimage import measure
from skimage.color import rgb2gray
from skimage import io
from skimage import filters
from skimage import feature

Detecting edges in images

For the purpose of illustration we use a cartoon image, i.e. an image that does not have any texture.

In [11]:
image = io.imread("../images/mickey-mouse-image.jpg")
grayscale = rgb2gray(image)
In [12]:
fig, ax = plt.subplots(figsize=(8, 8))
plt.imshow(grayscale, cmap=plt.cm.gray)
Out[12]:
<matplotlib.image.AxesImage at 0x7fe2a96c5d50>

Sobel operator

In [13]:
sobel_edges = filters.sobel(grayscale)
In [8]:
fig, ax = plt.subplots(figsize=(8, 8))
plt.imshow(sobel_edges, cmap=plt.cm.gray)
Out[8]:
<matplotlib.image.AxesImage at 0x7fe2a96dcfd0>
Explore: Replace the cartoon image with one of the medical images that are provide. For various reasons it would be beneficial to combine image smoothing and the computation of the partial derivatives in one step. How would you modify the Sobel operator?
In [ ]: