Canny finds edges through gradient detection, non‑max suppression, and hysteresis thresholding.
import cv2 def canny_edge(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) return cv2.Canny(gray, 100, 200)