Edge Detection
The process of image detection involves detecting sharp edges in the image. This edge detection is essential in the context of image recognition or object localization/detection. There are several algorithms for detecting edges due to its wide applicability. We’ll be using one such algorithm known as Canny Edge Detection.
Example: Python OpenCV Canny Edge Detection
Python3
import cv2 FILE_NAME = 'geeks.png' # Read image from disk. img = cv2.imread(FILE_NAME) # Canny edge detection. edges = cv2.Canny(img, 100 , 200 ) # Write image back to disk. cv2.imshow( 'Edges' , edges) cv2.waitKey( 0 ) cv2.destroyAllWindows() |
Output:
Getting Started with Python OpenCV
Computer Vision is one of the techniques from which we can understand images and videos and can extract information from them. It is a subset of artificial intelligence that collects information from digital images or videos.
Python OpenCV is the most popular computer vision library. By using it, one can process images and videos to identify objects, faces, or even handwriting of a human. When it is integrated with various libraries, such as NumPy, python is capable of processing the OpenCV array structure for analysis.
In this article, we will discuss Python OpenCV in detail along with some common operations like resizing, cropping, reading, saving images, etc with the help of good examples.