March 2019
Intermediate to advanced
532 pages
13h 2m
English
Grayscale images have only one channel. Therefore, some differences are introduced when working with these images. We are going to highlight these differences here.
Again, we will use the cv2.imread() function to read an image. In this case, the second argument is needed because we want to load the image in grayscale. The second argument is a flag specifying the way the image should be read. The value that's needed for loading an image in grayscale is cv2.IMREAD_GRAYSCALE:
# The function cv2.imshow() is used to display an image in a window# The first argument of this function is the window name# The second argument of this function is the image to be shown.# In this case, ...