March 2018
Beginner to intermediate
306 pages
9h 54m
English
The loaded image is represented as a NumPy array. The same representation is used in OpenCV for matrices. NumPy arrays have such properties as shape, which is an image's size and number of color channels, and dtype, which is the underlying data type (for example, uint8 or float32). Note that OpenCV loads images in BGR, not RGB, format.
The shape tuple in this case should be interpreted as follows: image height, image width, color channels count.
The cv.imread function also supports optional flags, where users can specify whether conversion to uint8 type should be performed, and whether the image is grayscale or color.
Having run the code with the default parameters, you should see the following output:
read ../data/Lena.png ...
Read now
Unlock full access