Canny edge detection is a very powerful and popular tool in computer vision. It's named after John F. Canny, who proposed the algorithm in 1986. OpenCV implements the algorithm in the function cv2.Canny. You must specify two thresholds for gradient magnitude in this function: the first one is used for detecting strong edges, and the second one is used for the hysteresis procedure, where the strong edges are being grown.
The following output is expected: