Edge detection
In this exercise, you'll detect edges in an image by applying the Sobel filter.

soaps_image
.Theshow_image()
function has been already loaded for you.
Let's see if it spots all the figures in the image.
Cet exercice fait partie du cours
Image Processing in Python
Instructions
- Import the
color
module so you can convert the image to grayscale. - Import the
sobel()
function fromfilters
module. - Make
soaps_image
grayscale using the appropriate method from thecolor
module. - Apply the sobel edge detection filter on the obtained grayscale image
soaps_image_gray
.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import the color module
from ____ import ____
# Import the filters module and sobel function
from skimage.____ import ____
# Make the image grayscale
soaps_image_gray = ____.____(soaps_image)
# Apply edge detection filter
edge_sobel = ____(____)
# Show original and resulting image to compare
show_image(soaps_image, "Original")
show_image(edge_sobel, "Edges with Sobel")