March 2020
Intermediate to advanced
366 pages
9h 8m
English
With the tricks that we learned from the previous sections in our bag, we are now ready to take a look at the entire procedure.
The following procedure shows you how to convert a color image into grayscale. After that, we aim to blend the grayscale image with its blurred negative:
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_RGB2GRAY)
As you can see, we have used cv2.COLOR_RGB2GRAY as a parameter to the cv2.cvtColor function, which changes the color spaces. Note that it does not matter whether the input image is RGB or BGR (which is the default for OpenCV); ...