As explained in previous chapters, an image Changing these pixel values also changes the image. One of the basic image manipulation techniques is modifying pixel values.
Let's start by displaying what is inside an image at pixel level. For simplicity, we will do analysis on a grayscale image:
# read an image
img = cv2.imread('gray_flower.png')
The earlier code reads a grayscale image from a file, in this case the image is in PNG format. We can also convert from one type of image color format to another. In this case, to convert a colored image to grayscale, OpenCV provides functions...