Python OpenCV Read Image
Python3
# Python code to read image import cv2 # To read image from disk, we use # cv2.imread function, in below method, img = cv2.imread( "geeks.png" , cv2.IMREAD_COLOR) print (img) |
Output:
[[[ 87 157 14] [ 87 157 14] [ 87 157 14] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]] [[ 87 157 14] [ 87 157 14] [ 87 157 14] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]] [[ 87 157 14] [ 87 157 14] [ 87 157 14] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]] ... [[ 72 133 9] [ 72 133 9] [ 72 133 9] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]] [[ 72 133 9] [ 72 133 9] [ 72 133 9] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]] [[ 72 133 9] [ 72 133 9] [ 72 133 9] ... [ 87 157 14] [ 87 157 14] [ 87 157 14]]]
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.