In this tutorial we'll find edges using the Sobel operator and Canny edge detector from OpenCV.
Please see the following official tutorials for more detailed explanations of the code.