Here we implemented a code that creates a canny image of an existing image with the help of OpenCV in python.
install OpenCV by using the command:
cmd:- pip install opencv-python
Save your image at the directory and mention the exact path in the code to read an image. Here, we created an image directory inside the directory where our code is saved and mention its path in our code. As "image/TomAndJerry.jpg" inside imread().
cv2.imread() method loads an image from the specified file.
cv2. imshow() method is used to display an image in a window.
And by using our code we can create a canny image of an image with the help of opencv library in python.
Submitted by Prachi Namdeo (prachi06)
Download packets of source code on Coders Packet