Edges are a useful image feature that can be used in many computer vision applications. In this recipe, you will learn how to detect edges in images using the Canny algorithm.
Finding edges using the Canny algorithm
Getting ready
Install the OpenCV 3.x Python API package and the matplotlib package.
How to do it...
Here are the steps needed to complete this recipe:
- Import the modules:
import cv2
import matplotlib.pyplot as plt
- Load the test image:
image = cv2.imread('../data/Lena.png')
- Detect the edges using the Canny algorithm:
edges = cv2.Canny(image, 200...